Tabnine Logo
ca.uhn.hl7v2.model.v25.message
Code IndexAdd Tabnine to your IDE (free)

How to use ca.uhn.hl7v2.model.v25.message

Best Java code snippets using ca.uhn.hl7v2.model.v25.message (Showing top 20 results out of 315)

origin: openmrs/openmrs-core

private MSH getMSH(ORU_R01 oru) {
  return oru.getMSH();
}

origin: openmrs/openmrs-core

private MSH getMSH(ADT_A05 adt) {
  return adt.getMSH();
}

origin: openmrs/openmrs-core

private PID getPID(ADT_A05 adt) {
  return adt.getPID();
}

origin: openmrs/openmrs-core

private ORC getORC(ORU_R01 oru) {
  return oru.getPATIENT_RESULT().getORDER_OBSERVATION().getORC();
}

origin: ca.uhn.hapi/hapi-structures-v25

/** 
 * <p>
 * Returns the number of existing repetitions of ROL2 
 * </p>
 * 
 */ 
public int getROL2Reps() { 
  return getReps("ROL2");
} 
origin: ca.uhn.hapi/hapi-structures-v25

/** 
 * Creates a new ADR_A19 message with custom ModelClassFactory.
 */
public ADR_A19(ModelClassFactory factory) {
  super(factory);
  init(factory);
}
origin: pentaho/pentaho-kettle

} else if ( ack instanceof ca.uhn.hl7v2.model.v25.message.ACK ) {
 ca.uhn.hl7v2.model.v25.message.ACK mod = (ca.uhn.hl7v2.model.v25.message.ACK) ack;
 mod.getMSH().getSendingApplication().getNamespaceID().setValue( APPNAME );
 mod.getMSH().getSendingFacility().getNamespaceID().setValue( APPNAME );
 ackMessage = mod.encode();
} else if ( ack instanceof ca.uhn.hl7v2.model.v251.message.ACK ) {
 ca.uhn.hl7v2.model.v251.message.ACK mod = (ca.uhn.hl7v2.model.v251.message.ACK) ack;
origin: openmrs/openmrs-core

private PID getPID(ORU_R01 oru) {
  return oru.getPATIENT_RESULT().getPATIENT().getPID();
}

origin: openmrs/openmrs-core

/**
 * @see ORUR01Handler#getForm(MSH)
 */
@Test
public void getForm_shouldPassIfReturnValueIsNullWhenUuidAndIdIsNull() throws Exception {
  String hl7String = "MSH|^~\\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20090728170332||ORU^R01|gu99yBh4loLX2mh9cHaV|P|2.5|1||||||||\r"
      + "PID|||3^^^^||Beren^John^Bondo||\r"
      + "NK1|1|Jones^Jane^Lee^^RN|3A^Parent^99REL||||||||||||F|19751016|||||||||||||||||2^^^L^PI\r"
      + "PV1||O|1^Unknown||||1^Super User (admin)|||||||||||||||||||||||||||||||||||||20090714|||||||V\r"
      + "ORC|RE||||||||20090728165937|1^Super User\r"
      + "OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT\r"
      + "OBX|2|NM|5497^CD4 COUNT^99DCT||123|||||||||20090714\r"
      + "OBR|3|||23^FOOD CONSTRUCT^99DCT\r"
      + "OBX|1|CWE|21^FOOD ASSISTANCE FOR ENTIRE FAMILY^99DCT||22^UNKNOWN^99DCT^2471^UNKNOWN^99NAM|||||||||20090714";
  
  ORUR01Handler oruHandler = new ORUR01Handler();
  Message hl7message = parser.parse(hl7String);
  ORU_R01 oru = (ORU_R01) hl7message;
  ca.uhn.hl7v2.model.v25.segment.MSH msh = oru.getMSH();
  Form form = oruHandler.getForm(msh);
  Assert.assertNull(form);
}
origin: ca.uhn.hapi/hapi-structures-v25

/** 
 * <p>
 * Returns the number of existing repetitions of DB1 
 * </p>
 * 
 */ 
public int getDB1Reps() { 
  return getReps("DB1");
} 
origin: openmrs/openmrs-core

private PV1 getPV1(ORU_R01 oru) {
  return oru.getPATIENT_RESULT().getPATIENT().getVISIT().getPV1();
}

origin: openmrs/openmrs-core

  /**
   * @see ORUR01Handler#getForm(MSH)
   */
  @Test
  public void getForm_shouldPassIfReturnValueIsNotNullWhenUuidOrIdIsNotNull() throws Exception {
    String hl7String = "MSH|^~\\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20090728170332||ORU^R01|gu99yBh4loLX2mh9cHaV|P|2.5|1||||||||16^AMRS.ELD.FORMID\r"
        + "PID|||3^^^^||Beren^John^Bondo||\r"
        + "NK1|1|Jones^Jane^Lee^^RN|3A^Parent^99REL||||||||||||F|19751016|||||||||||||||||2^^^L^PI\r"
        + "PV1||O|1^Unknown||||1^Super User (admin)|||||||||||||||||||||||||||||||||||||20090714|||||||V\r"
        + "ORC|RE||||||||20090728165937|1^Super User\r"
        + "OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT\r"
        + "OBX|2|NM|5497^CD4 COUNT^99DCT||123|||||||||20090714\r"
        + "OBR|3|||23^FOOD CONSTRUCT^99DCT\r"
        + "OBX|1|CWE|21^FOOD ASSISTANCE FOR ENTIRE FAMILY^99DCT||22^UNKNOWN^99DCT^2471^UNKNOWN^99NAM|||||||||20090714";
    
    ORUR01Handler oruHandler = new ORUR01Handler();
    Message hl7message = parser.parse(hl7String);
    ORU_R01 oru = (ORU_R01) hl7message;
    ca.uhn.hl7v2.model.v25.segment.MSH msh = oru.getMSH();
    Form form = oruHandler.getForm(msh);
    Assert.assertNotNull(form);    
    }
}
origin: ca.uhn.hapi/hapi-structures-v25

/** 
 * <p>
 * Returns the number of existing repetitions of DG1 
 * </p>
 * 
 */ 
public int getDG1Reps() { 
  return getReps("DG1");
} 
origin: openmrs/openmrs-core

/**
 * finds NK1 segments in an ORU_R01 message. all HAPI-rendered Messages have at least one NK1
 * segment but if the original message truly does not contain an NK1, the setID will be null on
 * the generated NK1
 *
 * @param oru ORU_R01 message to be parsed for NK1 segments
 * @return list of not-null NK1 segments
 * @throws HL7Exception
 */
public List<NK1> getNK1List(ORU_R01 oru) throws HL7Exception {
  List<NK1> res = new ArrayList<>();
  // there will always be at least one NK1, even if the original message does not contain one
  for (int i = 0; i < oru.getPATIENT_RESULT().getPATIENT().getNK1Reps(); i++) {
    // if the setIDNK1 value is null, this NK1 is blank
    if (oru.getPATIENT_RESULT().getPATIENT().getNK1(i).getSetIDNK1().getValue() != null) {
      res.add(oru.getPATIENT_RESULT().getPATIENT().getNK1(i));
    }
  }
  return res;
}

origin: openmrs/openmrs-core

/**
 * @throws HL7Exception
 * @see HL7Service#resolveUserId(ca.uhn.hl7v2.model.v25.datatype.XCN)
 */
@Test
public void resolveUserId_shouldReturnUserUsingFirstAndLastNameGivenUserIDIsNull() throws HL7Exception {
  HL7Service hl7service = Context.getHL7Service();
  //construct a message such that id Number at ORC is null
  Message message = hl7service
               .parseHL7String("MSH|^~\\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20080226102656||ORU^R01|JqnfhKKtouEz8kzTk6Zo|P|2.5|1||||||||16^AMRS.ELD.FORMID\r" +
                       "PID|||3^^^^||John3^Doe^||\r" +
                       "NK1|1|Hornblower^Horatio^L|2B^Sibling^99REL||||||||||||M|19410501|||||||||||||||||1000^^^L^PN||||\r" +
                       "ORC|RE||||||||20080226102537|^Otterbourg^Bruno\r" +
                       "OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT\r" +
                       "OBX|1|NM|5497^CD4, BY FACS^99DCT||450|||||||||20080206\r" +
                       "OBX|2|DT|5096^RETURN VISIT DATE^99DCT||20080229|||||||||20080212");
  ORU_R01 oru = (ORU_R01) message;
  ORC orc = oru.getPATIENT_RESULT().getORDER_OBSERVATION().getORC();
  XCN xcn = orc.getEnteredBy(0);
  Integer userId = hl7service.resolveUserId(xcn);
  assertThat(userId, is(501));
}

origin: openmrs/openmrs-core

  /**
   * @throws HL7Exception
   * @see HL7Service#resolveUserId(ca.uhn.hl7v2.model.v25.datatype.XCN)
   */
  @Test
  public void resolveUserId_shouldReturnUserUsingUsername() throws HL7Exception {
    HL7Service hl7service = Context.getHL7Service();
    //construct a message such that id Number at ORC is null
    Message message = hl7service
        .parseHL7String("MSH|^~\\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20080226102656||ORU^R01|JqnfhKKtouEz8kzTk6Zo|P|2.5|1||||||||16^AMRS.ELD.FORMID\r" +
            "PID|||3^^^^||John3^Doe^||\r" +
            "NK1|1|Hornblower^Horatio^L|2B^Sibling^99REL||||||||||||M|19410501|||||||||||||||||1000^^^L^PN||||\r" +
            "ORC|RE||||||||20080226102537|^butch\r" +
            "OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT\r" +
            "OBX|1|NM|5497^CD4, BY FACS^99DCT||450|||||||||20080206\r" +
            "OBX|2|DT|5096^RETURN VISIT DATE^99DCT||20080229|||||||||20080212");
    ORU_R01 oru = (ORU_R01) message;
    ORC orc = oru.getPATIENT_RESULT().getORDER_OBSERVATION().getORC();
    XCN xcn = orc.getEnteredBy(0);
    Integer userId = hl7service.resolveUserId(xcn);
    assertThat(userId, is(502));
  }
}
origin: openmrs/openmrs-core

/**
 * @throws HL7Exception
 * @see HL7Service#resolveLocationId(ca.uhn.hl7v2.model.v25.datatype.PL)
 */
@Test
public void resolveLocationId_shouldReturnInternalIdentifierOfLocationIfOnlyLocationIdIsSpecified() throws HL7Exception {
  executeDataSet("org/openmrs/hl7/include/ORUTest-initialData.xml");
  HL7Service hl7service = Context.getHL7Service();
  Message message = hl7service
      .parseHL7String("MSH|^~\\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20080226102656||ORU^R01|JqnfhKKtouEz8kzTk6Zo|P|2.5|1||||||||16^AMRS.ELD.FORMID\r"
          + "PID|||3^^^^||John3^Doe^||\r"
          + "NK1|1|Hornblower^Horatio^L|2B^Sibling^99REL||||||||||||M|19410501|||||||||||||||||1000^^^L^PN||||\r"
          + "PV1||O|1^0^0^0&Test Location&0||||1^Super User (1-8)|||||||||||||||||||||||||||||||||||||20080212|||||||V\r"
          + "ORC|RE||||||||20080226102537|1^Super User\r"
          + "OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT\r"
          + "OBX|1|NM|5497^CD4, BY FACS^99DCT||450|||||||||20080206\r"
          + "OBX|2|DT|5096^RETURN VISIT DATE^99DCT||20080229|||||||||20080212");
  ORU_R01 oru = (ORU_R01) message;
  PV1 pv1 = oru.getPATIENT_RESULT().getPATIENT().getVISIT().getPV1();
  Assert.assertNotNull("PV1 parsed as null", pv1);
  PL hl7Location = pv1.getAssignedPatientLocation();
  Integer locationId = hl7service.resolveLocationId(hl7Location);
  Assert.assertEquals("Resolved and given locationId shoud be equals", Integer.valueOf(1), locationId);
}

origin: openmrs/openmrs-core

/**
 * @throws HL7Exception
 * @see HL7Service#resolveLocationId(ca.uhn.hl7v2.model.v25.datatype.PL)
 */
@Test
public void resolveLocationId_shouldReturnInternalIdentifierOfLocationIfOnlyLocationNameIsSpecified()
    throws HL7Exception {
  executeDataSet("org/openmrs/hl7/include/ORUTest-initialData.xml");
  HL7Service hl7service = Context.getHL7Service();
  Message message = hl7service
      .parseHL7String("MSH|^~\\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20080226102656||ORU^R01|JqnfhKKtouEz8kzTk6Zo|P|2.5|1||||||||16^AMRS.ELD.FORMID\r"
          + "PID|||3^^^^||John3^Doe^||\r"
          + "NK1|1|Hornblower^Horatio^L|2B^Sibling^99REL||||||||||||M|19410501|||||||||||||||||1000^^^L^PN||||\r"
          + "PV1||O|99999^0^0^0&Test Location&0||||1^Super User (1-8)|||||||||||||||||||||||||||||||||||||20080212|||||||V\r"
          + "ORC|RE||||||||20080226102537|1^Super User\r"
          + "OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT\r"
          + "OBX|1|NM|5497^CD4, BY FACS^99DCT||450|||||||||20080206\r"
          + "OBX|2|DT|5096^RETURN VISIT DATE^99DCT||20080229|||||||||20080212");
  ORU_R01 oru = (ORU_R01) message;
  PV1 pv1 = oru.getPATIENT_RESULT().getPATIENT().getVISIT().getPV1();
  Assert.assertNotNull("PV1 parsed as null", pv1);
  PL hl7Location = pv1.getAssignedPatientLocation();
  Integer locationId = hl7service.resolveLocationId(hl7Location);
  Assert.assertEquals("Resolved and given locationId shoud be equals", Integer.valueOf(1), locationId);
}

origin: openmrs/openmrs-core

/**
 * @throws HL7Exception
 * @see HL7Service#resolveUserId(ca.uhn.hl7v2.model.v25.datatype.XCN)
 */
@Test
public void resolveUserId_shouldReturnNullForAmbiguousUsersUsingFirstAndLastNameGivenUserIDIsNull() throws HL7Exception {
  HL7Service hl7service = Context.getHL7Service();
  executeDataSet(XML_FILENAME);
  //construct a message such that id Number at ORC is null
  Message message = hl7service
               .parseHL7String("MSH|^~\\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20080226102656||ORU^R01|JqnfhKKtouEz8kzTk6Zo|P|2.5|1||||||||16^AMRS.ELD.FORMID\r" +
                       "PID|||3^^^^||John3^Doe^||\r" +
                       "NK1|1|Hornblower^Horatio^L|2B^Sibling^99REL||||||||||||M|19410501|||||||||||||||||1000^^^L^PN||||\r" +
                       "PV1||O|99999^0^0^0&Unknown&0||||^Super User (1-8)|||||||||||||||||||||||||||||||||||||20080212|||||||V\r" +
                       "ORC|RE||||||||20080226102537|^User^Super\r" +
                       "OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT\r" +
                       "OBX|1|NM|5497^CD4, BY FACS^99DCT||450|||||||||20080206\r" +
                       "OBX|2|DT|5096^RETURN VISIT DATE^99DCT||20080229|||||||||20080212");
  ORU_R01 oru = (ORU_R01) message;
  ORC orc = oru.getPATIENT_RESULT().getORDER_OBSERVATION().getORC();
  XCN xcn = orc.getEnteredBy(0);
  //userId should be null since there exist two ambiguous users that has givename=Super and lastname=User.
  Integer userId = hl7service.resolveUserId(xcn);
  Assert.assertNull(userId);
}
origin: openmrs/openmrs-core

/**
 * @throws HL7Exception
 * @see HL7Service#resolveLocationId(ca.uhn.hl7v2.model.v25.datatype.PL)
 */
@Test
public void resolveLocationId_shouldReturnNullIfLocationIdAndNameAreIncorrect() throws HL7Exception {
  executeDataSet("org/openmrs/hl7/include/ORUTest-initialData.xml");
  HL7Service hl7service = Context.getHL7Service();
  Message message = hl7service
      .parseHL7String("MSH|^~\\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20080226102656||ORU^R01|JqnfhKKtouEz8kzTk6Zo|P|2.5|1||||||||16^AMRS.ELD.FORMID\r"
          + "PID|||3^^^^||John3^Doe^||\r"
          + "NK1|1|Hornblower^Horatio^L|2B^Sibling^99REL||||||||||||M|19410501|||||||||||||||||1000^^^L^PN||||\r"
          + "PV1||O|99999^0^0^0&Unknown&0||||1^Super User (1-8)|||||||||||||||||||||||||||||||||||||20080212|||||||V\r"
          + "ORC|RE||||||||20080226102537|1^Super User\r"
          + "OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT\r"
          + "OBX|1|NM|5497^CD4, BY FACS^99DCT||450|||||||||20080206\r"
          + "OBX|2|DT|5096^RETURN VISIT DATE^99DCT||20080229|||||||||20080212");
  ORU_R01 oru = (ORU_R01) message;
  PV1 pv1 = oru.getPATIENT_RESULT().getPATIENT().getVISIT().getPV1();
  Assert.assertNotNull("PV1 parsed as null", pv1);
  PL hl7Location = pv1.getAssignedPatientLocation();
  Integer locationId = hl7service.resolveLocationId(hl7Location);
  Assert.assertNull(locationId);
}

ca.uhn.hl7v2.model.v25.message

Most used classes

  • ORU_R01
    Represents a ORU_R01 message structure (see chapter 5.7.3.1). This structure contains the following
  • ACK
    Represents a ACK message structure (see chapter 2.14.1). This structure contains the following eleme
  • ADT_A01
    Represents a ADT_A01 message structure (see chapter 3.3.1). This structure contains the following el
  • ADT_A05
    Represents a ADT_A05 message structure (see chapter 3.3.14). This structure contains the following e
  • ADR_A19
    Represents a ADR_A19 message structure (see chapter 3.3.19). This structure contains the following e
  • ADT_A03,
  • ADT_A06,
  • ADT_A09,
  • ADT_A12,
  • ADT_A15,
  • ADT_A16,
  • ADT_A17,
  • ADT_A18,
  • ADT_A20,
  • ADT_A21,
  • ADT_A24,
  • ADT_A30,
  • ADT_A37,
  • ADT_A38
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now