use of org.hl7.fhir.dstu3.model.Immunization in project hl7v2-fhir-converter by LinuxForHealth.
the class Hl7ImmunizationFHIRConversionTest method testImmunizationDefaultCompletedMEDPRECStatusReason.
@Test
void testImmunizationDefaultCompletedMEDPRECStatusReason() throws IOException {
// Status defaults to completed RXA.20, RXA.18 and ORC.5 are empty
// Status reason is MEDPREC when OBX.3 is 30945-0 RXA.18 and RXA.20 not provided
String hl7VUXmessageRep = "MSH|^~\\&|MYEHR2.5|RI88140101|KIDSNET_IFL|RIHEALTH|20130531||VXU^V04^VXU_V04|20130531RI881401010105|P|2.5.1|||NE|AL||||||RI543763\r" + "PID|1||12345^^^^MR||TestPatient^Jane^^^^^L||||||\r" + "ORC|||197027|||||||^Clerk^Myron|||||||RI2050\r" + "RXA|0|1|20130531||48^HIB PRP-T^CVX|999|||1|\r" + "OBX|1|CE|30945-0^contraindication^LN|1|V02^VFC eligible Medicaid/MedicaidManaged Care^HL70064||||||F||||||\r";
Immunization immunization = ResourceUtils.getImmunization(ftv, hl7VUXmessageRep);
// Status defaults to completed
assertThat(immunization.getStatus().getDisplay()).isEqualTo("completed");
assertThat(immunization.hasStatusReason()).isTrue();
assertThat(immunization.getStatusReason().getCoding()).hasSize(2);
assertThat(immunization.getStatusReason().getCoding().get(0).getCode()).isEqualTo("MEDPREC");
assertThat(immunization.getStatusReason().getCoding().get(0).getSystem()).isEqualTo("http://terminology.hl7.org/CodeSystem/v3-ActReason");
assertThat(immunization.getStatusReason().getCoding().get(0).getDisplay()).isEqualTo("medical precaution");
assertThat(immunization.getStatusReason().getCoding().get(1).getCode()).isEqualTo("30945-0");
assertThat(immunization.getStatusReason().getCoding().get(1).getSystem()).isEqualTo("http://loinc.org");
assertThat(immunization.getStatusReason().getCoding().get(1).getDisplay()).isEqualTo("contraindication");
assertThat(immunization.getStatusReason().getText()).isEqualTo("contraindication");
}
use of org.hl7.fhir.dstu3.model.Immunization in project hl7v2-fhir-converter by LinuxForHealth.
the class Hl7ImmunizationFHIRConversionTest method testImmunizationAdministrationPlaceOrg1.
@Test
// Test priority of Immunization Performer sourcing is tested.
void testImmunizationAdministrationPlaceOrg1() throws IOException {
String hl7VUXmessageRep = "MSH|^~\\&|||||20140701041038||VXU^V04^VXU_V04|MSG.Valid_01|P|2.6|||\n" + "PID|||1234^^^^MR||DOE^JANE^|||F||||||||||||||||||||||\r" + // PV1.3.4 to Organization referenced by Encounter.serviceProvider; but bypassed for Immunization.performer because RXA.27.4 has priority
"PV1||O|^^^PlacePV1.3.4\r" + "ORC|||197027|||||||^Clerk^Myron|||||||RI2050\r" + // RXA.12 - RXA.26 not used
"RXA|0|1|20130531||48^HIB PRP-T^CVX||||||^^^PlaceRXA11|||||||||||||||" + // RXA.27 to Immunization Performer
"|^^^PlaceRXA274\r" + "OBX|1|CE|59784-9^Disease with presumed immunity^LN||\r";
List<Bundle.BundleEntryComponent> e = ResourceUtils.createFHIRBundleFromHL7MessageReturnEntryList(ftv, hl7VUXmessageRep);
// We expect two different organizations, one for Encounter.serviceProvider, one for Immunization.performer
List<Resource> organizations = ResourceUtils.getResourceList(e, ResourceType.Organization);
assertThat(organizations).hasSize(2);
Organization org1 = (Organization) organizations.get(0);
Organization org2 = (Organization) organizations.get(1);
// RXA.27.4
String orgId1 = org1.getId();
// RXA.27.4
assertThat(orgId1).isEqualTo("Organization/placerxa274");
// PV1.3.4
String orgId2 = org2.getId();
// PV1.3.4
assertThat(orgId2).isEqualTo("Organization/placepv1.3.4");
List<Resource> immunizations = ResourceUtils.getResourceList(e, ResourceType.Immunization);
assertThat(immunizations).hasSize(1);
Immunization imm = (Immunization) immunizations.get(0);
// RXA.27.4
assertThat(imm.getPerformer()).hasSize(1);
// RXA.27
assertThat(imm.getPerformerFirstRep().getActor().getReference()).isEqualTo(orgId1);
List<Resource> encounters = ResourceUtils.getResourceList(e, ResourceType.Encounter);
assertThat(encounters).hasSize(1);
Encounter enc = (Encounter) encounters.get(0);
// PV1.3.4
assertThat(enc.getServiceProvider().getReference()).isEqualTo(orgId2);
// Check for expected resources: Organizations (2), Immunization, Encounter, Patient
assertThat(e).hasSize(5);
}
use of org.hl7.fhir.dstu3.model.Immunization in project hl7v2-fhir-converter by LinuxForHealth.
the class Hl7ImmunizationFHIRConversionTest method testImmunizationOBX3is309567.
@Test
void testImmunizationOBX3is309567() throws IOException {
// When OBX.3 is 30956-7 and RXA.5 is not provided we get a vaccine code from OBX.5
String hl7VUXmessageRep = "MSH|^~\\&|EHR|12345^SiteName|MIIS|99990|20140701041038||VXU^V04^VXU_V04|MSG.Valid_01|P|2.6|||\n" + "PID|||1234^^^^MR||DOE^JANE^|||F||||||||||||||||||||||\r" + "ORC|||197027|||||||^Clerk^Myron|||||||RI2050\r" + "RXA|0|1|20130531\r" + "OBX|1|CWE|30956-7^vaccine type^LN|1|107^DTAP^CVX\r";
Immunization immunization = ResourceUtils.getImmunization(ftv, hl7VUXmessageRep);
// Status defaults to completed
assertThat(immunization.getStatus().getDisplay()).isEqualTo("completed");
assertThat(immunization.hasStatusReason()).isFalse();
assertThat(immunization.hasReaction()).isFalse();
assertThat(immunization.hasProgramEligibility()).isFalse();
assertThat(immunization.hasFundingSource()).isFalse();
// When OBX.3 is 30956-7 we get a vaccine code
assertThat(immunization.hasVaccineCode()).isTrue();
assertThat(immunization.getVaccineCode().getCodingFirstRep().getCode()).isEqualTo("107");
assertThat(immunization.getVaccineCode().getCodingFirstRep().getDisplay()).isEqualTo("DTAP");
assertThat(immunization.getVaccineCode().getCodingFirstRep().getSystem()).isEqualTo("http://hl7.org/fhir/sid/cvx");
assertThat(immunization.getVaccineCode().getText()).isEqualTo("DTAP");
}
use of org.hl7.fhir.dstu3.model.Immunization in project hl7v2-fhir-converter by LinuxForHealth.
the class Hl7ImmunizationFHIRConversionTest method testImmunizationReasonImmune2.
@Test
void testImmunizationReasonImmune2() throws IOException {
// Status reason is IMMUNE when OBX.3 is 59784-9, RXA.18 not provided, and RXA.20 is not RE
String hl7VUXmessageRep = "MSH|^~\\&|EHR|12345^SiteName|MIIS|99990|20140701041038||VXU^V04^VXU_V04|MSG.Valid_01|P|2.6|||\n" + "PID|||1234^^^^MR||DOE^JANE^|||F||||||||||||||||||||||\r" + "ORC|||197027|||||||^Clerk^Myron|||||||RI2050\r" + // RXA.20 is not RE, so OBX.3==59784-9 is activated; yeilds status not-done
"RXA|0|1|20130531||48^HIB PRP-T^CVX|||||||||||||||NA\r" + "OBX|1|CE|59784-9^Disease with presumed immunity^LN|1|V02^VFC eligible Medicaid/MedicaidManaged Care^HL70064\r";
Immunization immunization = ResourceUtils.getImmunization(ftv, hl7VUXmessageRep);
// RXA.20
assertThat(immunization.getStatus().getDisplay()).isEqualTo("not-done");
assertThat(immunization.hasStatusReason()).isTrue();
assertThat(immunization.getStatusReason().getCoding()).hasSize(2);
// From OBX.3==59784-9
assertThat(immunization.getStatusReason().getCoding().get(0).getCode()).isEqualTo("IMMUNE");
assertThat(immunization.getStatusReason().getCoding().get(0).getSystem()).isEqualTo("http://terminology.hl7.org/CodeSystem/v3-ActReason");
assertThat(immunization.getStatusReason().getCoding().get(0).getDisplay()).isEqualTo("immunity");
assertThat(immunization.getStatusReason().getCoding().get(1).getCode()).isEqualTo("59784-9");
assertThat(immunization.getStatusReason().getCoding().get(1).getSystem()).isEqualTo("http://loinc.org");
assertThat(immunization.getStatusReason().getCoding().get(1).getDisplay()).isEqualTo("Disease with presumed immunity");
assertThat(immunization.getStatusReason().getText()).isEqualTo("Disease with presumed immunity");
}
use of org.hl7.fhir.dstu3.model.Immunization in project hl7v2-fhir-converter by LinuxForHealth.
the class Hl7ImmunizationFHIRConversionTest method testImmunizationStatusReasonMEDPREC2.
@Test
void testImmunizationStatusReasonMEDPREC2() throws IOException {
// Status reason is MEDPREC when OBX.3 is 30945-0, RXA.18 empty, and RXA.20 not RE
String hl7VUXmessageRep = "MSH|^~\\&|MYEHR2.5|RI88140101|KIDSNET_IFL|RIHEALTH|20130531||VXU^V04^VXU_V04|20130531RI881401010105|P|2.5.1|||NE|AL||||||RI543763\r" + "PID|1||12345^^^^MR||TestPatient^Jane^^^^^L||||||\r" + "ORC|||197027|||||||^Clerk^Myron|||||||RI2050\r" + // RXA.20 is not RE, so OBX.3==30945-0 is activated; yeilds status not-done and MEDPREC statusReason
"RXA|0|1|20130531||48^HIB PRP-T^CVX|||||||||||||||NA\r" + "OBX|1|CE|30945-0^contraindication^LN|1|V02^VFC eligible Medicaid/MedicaidManaged Care^HL70064||||||F||||||\r";
Immunization immunization = ResourceUtils.getImmunization(ftv, hl7VUXmessageRep);
// RXA-20
assertThat(immunization.getStatus().getDisplay()).isEqualTo("not-done");
assertThat(immunization.hasStatusReason()).isTrue();
assertThat(immunization.getStatusReason().getCoding()).hasSize(2);
assertThat(immunization.getStatusReason().getCoding().get(0).getCode()).isEqualTo("MEDPREC");
assertThat(immunization.getStatusReason().getCoding().get(0).getSystem()).isEqualTo("http://terminology.hl7.org/CodeSystem/v3-ActReason");
assertThat(immunization.getStatusReason().getCoding().get(0).getDisplay()).isEqualTo("medical precaution");
assertThat(immunization.getStatusReason().getCoding().get(1).getCode()).isEqualTo("30945-0");
assertThat(immunization.getStatusReason().getCoding().get(1).getSystem()).isEqualTo("http://loinc.org");
assertThat(immunization.getStatusReason().getCoding().get(1).getDisplay()).isEqualTo("contraindication");
assertThat(immunization.getStatusReason().getText()).isEqualTo("contraindication");
}
Aggregations