当前位置: 首页>>代码示例>>Java>>正文


Java AbstractSegment类代码示例

本文整理汇总了Java中ca.uhn.hl7v2.model.AbstractSegment的典型用法代码示例。如果您正苦于以下问题:Java AbstractSegment类的具体用法?Java AbstractSegment怎么用?Java AbstractSegment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AbstractSegment类属于ca.uhn.hl7v2.model包,在下文中一共展示了AbstractSegment类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testStructureByIndex

import ca.uhn.hl7v2.model.AbstractSegment; //导入依赖的package包/类
protected <T extends Structure> void testStructureByIndex(int index,
                                                          Class<T> clazz)
    throws HL7Exception
{
    
    List<T> exepectedSegments =
        HapiUtil.getAll(this.expectedMessage, clazz);
    // re-eval to remove cleared segments
    List<T> actualSegments =
        HapiUtil.getAll((AbstractMessage) this.pipeParser
            .parse(this.actualMessage.encode()), clazz);
    
    if (exepectedSegments.size() < index + 1 ||
        actualSegments.size() < index + 1)
        return;
    
    assertEquals(
        ((AbstractSegment) exepectedSegments.get(index)).encode(),
        ((AbstractSegment) actualSegments.get(index)).encode());
}
 
开发者ID:KingsCollegeHospital,项目名称:rassyeyanie,代码行数:21,代码来源:AbstractHl7Test.java

示例2: assertEqualFields

import ca.uhn.hl7v2.model.AbstractSegment; //导入依赖的package包/类
protected <T extends AbstractSegment> void
    assertEqualFields(AbstractMessage expected,
                      AbstractMessage actual,
                      Class<T> clazz)
        throws HL7Exception
{
    Assert.assertEquals(
        HapiUtil.getWithTerser(expected, clazz).encode(),
        HapiUtil.getWithTerser(actual, clazz).encode());
}
 
开发者ID:KingsCollegeHospital,项目名称:rassyeyanie,代码行数:11,代码来源:AbstractHl7Test.java

示例3: assertEquals

import ca.uhn.hl7v2.model.AbstractSegment; //导入依赖的package包/类
protected void assertEquals(Structure expectedSegment,
                            Structure actualSegment)
    throws HL7Exception
{
    assertEquals(
        ((AbstractSegment) expectedSegment).encode(),
        ((AbstractSegment) actualSegment).encode());
}
 
开发者ID:KingsCollegeHospital,项目名称:rassyeyanie,代码行数:9,代码来源:AbstractHl7Test.java

示例4: processMessage

import ca.uhn.hl7v2.model.AbstractSegment; //导入依赖的package包/类
public void processMessage(@Body ADT_A09 to)
    throws HL7Exception
{
    this.transform(to.getMSH());
    this.transform(to.getEVN());
    this.transform(to.getPID());
    AbstractSegment zref = (AbstractSegment) to.get("ZRF");
    this.transform(to.getPV1(), zref);
    zref.clear();
}
 
开发者ID:KingsCollegeHospital,项目名称:rassyeyanie,代码行数:11,代码来源:SymA12PimsA11.java

示例5: processMessage

import ca.uhn.hl7v2.model.AbstractSegment; //导入依赖的package包/类
public void processMessage(@Body ADT_A02 to)
    throws HL7Exception
{
    this.transform(to.getEVN());
    this.transform(to.getPID());
    AbstractSegment zref = (AbstractSegment) to.get("ZRF");
    this.transform(to.getPV1(), zref);
    zref.clear();
}
 
开发者ID:KingsCollegeHospital,项目名称:rassyeyanie,代码行数:10,代码来源:SymA02PimsA02.java

示例6: processMessage

import ca.uhn.hl7v2.model.AbstractSegment; //导入依赖的package包/类
public void processMessage(@Body ADT_A03 to)
    throws HL7Exception
{
    this.transform(to.getMSH());
    this.transform(to.getEVN());
    this.transform(to.getPID());
    AbstractGroup zrefParent = getZrefParent(to);
    AbstractSegment zref = (AbstractSegment) zrefParent.get("ZRF");
    this.transform(to.getPV1(), zref);
    zref.clear();
    for (int i = 0; i < to.getDG1Reps(); i++)
    {
        to.getDG1(i).clear();
    }
    
    for (Structure al1 : zrefParent.getAll("AL1"))
    {
        ((AL1) al1).clear();
    }
    
    for (Structure nte : zrefParent.getAll("NTE"))
    {
        ((NTE) nte).clear();
    }
    
    if (zrefParent instanceof ADT_A03_PROCEDURE)
    {
        zrefParent.clear();
    }
}
 
开发者ID:KingsCollegeHospital,项目名称:rassyeyanie,代码行数:31,代码来源:SymA03PimsA02.java

示例7: dispatchProcessFixture

import ca.uhn.hl7v2.model.AbstractSegment; //导入依赖的package包/类
public void dispatchProcessFixture(@Body ADT_A03 to)
    throws HL7Exception
{
    AbstractGroup zrefParent = getZrefParent(to);
    AbstractSegment zref = (AbstractSegment) zrefParent.get("ZRF");
    
    this.transform(to.getPV1(), zref, to.getEVN());
    this.transform(to.getEVN());
    this.transform(to.getMSH());
    this.transform(to.getPID());
    
    for (int i = 0; i < to.getDG1Reps(); i++)
    {
        to.getDG1(i).clear();
    }
    
    for (Structure al1 : zrefParent.getAll("AL1"))
    {
        ((AL1) al1).clear();
    }
    
    for (Structure nte : zrefParent.getAll("NTE"))
    {
        ((NTE) nte).clear();
    }
    
    if (zrefParent instanceof ADT_A03_PROCEDURE)
    {
        to.addNonstandardSegment("ZRF");
        Segment zrf = (Segment) to.insertRepetition("ZRF", 0);
        DeepCopy.copy(zref, zrf);
        to.insertRepetition("ZRF", 0);
        zrefParent.clear();
    }
    
}
 
开发者ID:KingsCollegeHospital,项目名称:rassyeyanie,代码行数:37,代码来源:SymA03PimsA01.java

示例8: processMessage

import ca.uhn.hl7v2.model.AbstractSegment; //导入依赖的package包/类
public void processMessage(@Body ADT_A03 to)
    throws HL7Exception
{
    this.transform(to.getPID());
    AbstractGroup zrefParent = getZrefParent(to);
    AbstractSegment zref = (AbstractSegment) zrefParent.get("ZRF");
    this.transform(to.getPV1(), zref, to.getEVN());
    
    for (int i = 0; i < to.getDG1Reps(); i++)
    {
        to.getDG1(i).clear();
    }
    
    for (Structure al1 : zrefParent.getAll("AL1"))
    {
        ((AL1) al1).clear();
    }
    for (Structure nte : zrefParent.getAll("NTE"))
    {
        ((NTE) nte).clear();
    }
    
    this.transformZref(zref, to.getPV1());
    
    if (zrefParent instanceof ADT_A03_PROCEDURE)
    {
        zrefParent.clear();
    }
}
 
开发者ID:KingsCollegeHospital,项目名称:rassyeyanie,代码行数:30,代码来源:SymA03PimsA03.java

示例9: segment_tester

import ca.uhn.hl7v2.model.AbstractSegment; //导入依赖的package包/类
public <T extends AbstractSegment> void segment_tester(Class<T> clazz)
    throws Exception
{
    this.assertEqualFields(this.expectedMessage, this.actualMessage, clazz);
}
 
开发者ID:KingsCollegeHospital,项目名称:rassyeyanie,代码行数:6,代码来源:AbstractHl7Test.java

示例10: transform

import ca.uhn.hl7v2.model.AbstractSegment; //导入依赖的package包/类
private void transform(PV1 pv1, AbstractSegment zref)
    throws HL7Exception
{
    pv1.getPv12_PatientClass().setValue("I");
    
    pv1
        .getPv13_AssignedPatientLocation()
        .getPl4_Facility()
        .getHd1_NamespaceID()
        .setValue("KCH");
    pv1
        .getPv13_AssignedPatientLocation()
        .getPl9_LocationDescription()
        .setValue(
            pv1
                .getPv137_DischargedToLocation()
                .getDld2_EffectiveDate()
                .getTs1_TimeOfAnEvent()
                .getValue());
    
    pv1.getPv14_AdmissionType().setValue("21");
    
    for (int i = 6; i <= 8; i++)
    {
        pv1.getField(i, 0).clear();
    }
    
    CE referralBySpecialty = new CE(pv1.getMessage());
    ((Varies) zref.getField(8, 0)).setData(referralBySpecialty);
    
    pv1.getPv110_HospitalService().setValue(
        referralBySpecialty.getCe1_Identifier().getValue());
    
    XCN referredTo = new XCN(pv1.getMessage());
    ((Varies) zref.getField(7, 0)).setData(referredTo);
    pv1
        .getPv117_AdmittingDoctor(0)
        .getXcn1_IDNumber()
        .setValue(referredTo.getXcn1_IDNumber().getValue());
    
    CE admitCategory = new CE(pv1.getMessage());
    ((Varies) zref.getField(12, 0)).setData(admitCategory);
    
    pv1.getPv118_PatientType().setValue(
        admitCategory.getCe1_Identifier().getValue());
    
    pv1.getPv122_CourtesyCode().setValue("NSP");
    
    for (int i = 23; i <= 27; i++)
    {
        pv1.getField(i, 0).clear();
    }
    
    pv1.getPv128_InterestCode().setValue("NSP");
    
    for (int i = 29; i <= 39; i++)
    {
        pv1.getField(i, 0).clear();
    }
    
    pv1.getPv136_DischargeDisposition().setValue("NSP");
    pv1
        .getPv137_DischargedToLocation()
        .getDld1_DischargeLocation()
        .setValue("NSP");
    pv1.getPv138_DietType().getCe1_Identifier().setValue("NA");
    
    pv1.getPv140_BedStatus().setValue("NSP");
    
    for (int i = 45; i <= 49; i++)
    {
        pv1.getField(i, 0).clear();
    }
}
 
开发者ID:KingsCollegeHospital,项目名称:rassyeyanie,代码行数:75,代码来源:SymA12PimsA11.java

示例11: transform

import ca.uhn.hl7v2.model.AbstractSegment; //导入依赖的package包/类
private void transform(PV1 pv1, AbstractSegment zref)
    throws HL7Exception
{
    pv1.getPv11_SetIDPV1().clear();
    pv1
        .getPv13_AssignedPatientLocation()
        .getPl9_LocationDescription()
        .setValue(
            pv1
                .getPv137_DischargedToLocation()
                .getDld1_DischargeLocation()
                .getValue());
    pv1
        .getPv13_AssignedPatientLocation()
        .getPl4_Facility()
        .getHd1_NamespaceID()
        .setValue("KCH");
    pv1.getPv16_PriorPatientLocation().getPl4_Facility().clear();
    pv1.getPv16_PriorPatientLocation().getPl9_LocationDescription().clear();
    
    for (int i = 7; i <= 8; i++)
    {
        pv1.getField(i, 0).clear();
    }
    
    XCN referredTo = new XCN(pv1.getMessage());
    ((Varies) zref.getField(7, 0)).setData(referredTo);
    pv1
        .getPv19_ConsultingDoctor(0)
        .getXcn1_IDNumber()
        .setValue(referredTo.getXcn1_IDNumber().getValue());
    
    CE referralBySpecialty = new CE(pv1.getMessage());
    ((Varies) zref.getField(9, 0)).setData(referralBySpecialty);
    
    if (StringUtils.isNotEmpty(referralBySpecialty
        .getCe1_Identifier()
        .getValue()))
    {
        pv1.getPv110_HospitalService().setValue(
            referralBySpecialty.getCe1_Identifier().getValue());
    }
    else
    {
        pv1.getPv110_HospitalService().setValue("NSP");
    }
    
    pv1
        .getPv117_AdmittingDoctor(0)
        .getXcn1_IDNumber()
        .setValue(referredTo.getXcn1_IDNumber().getValue());
    
    CE admitCategory = new CE(pv1.getMessage());
    ((Varies) zref.getField(12, 0)).setData(admitCategory);
    
    pv1.getPv118_PatientType().setValue(
        admitCategory.getCe1_Identifier().getValue());
    
    pv1.getPv122_CourtesyCode().setValue("NSP");
    pv1.getPv128_InterestCode().setValue("NSP");
    pv1.getPv140_BedStatus().setValue("NSP");
    
    for (int i = 46; i <= 52; i++)
    {
        pv1.getField(i, 0).clear();
    }
}
 
开发者ID:KingsCollegeHospital,项目名称:rassyeyanie,代码行数:68,代码来源:SymA02PimsA02.java


注:本文中的ca.uhn.hl7v2.model.AbstractSegment类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。