Skip to content

Commit

Permalink
Merge pull request #314 from LinuxForHealth/Remove-OBR.7,-8,-24-from-…
Browse files Browse the repository at this point in the history
…DocumentReference.context

Remove OBR.7, 8, 24 from DocumentReference.context
  • Loading branch information
cragun47 authored Oct 25, 2021
2 parents 8f55932 + 24c6baa commit 5540f46
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/main/resources/hl7/resource/DocumentReference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ context:
valueOf: secondary/Context
expressionType: resource
vars:
practiceSettingIn: OBR.24
timestamp: TXA.4 | OBR.7
timestamp: TXA.4
providerCode: TXA.5
serviceRequestRef: $ServiceRequest
encounterRef: $Encounter
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ public void testPprPc1ServiceRequestPresentDocumentReferenceDetails() throws IOE
+ "OBX|1|NM|111^TotalProtein||7.5|gm/dl|5.9-8.4||||F\n"
+ "NTE|1|P|Problem Comments\n"
+ "ORC|NW|1000^OE|9999999^RX|||E|^Q6H^D10^^^R\n"
// OBR.7 is used for the timestamp (because no TXA in a PPR_PC1 message)
+ "OBR|1|TESTID|TESTID|||201801180346|201801180347||||||||||||||||||F||||||WEAKNESS||||||||||||\n"
// Next three lines create an attachment because OBX type TX
+ "OBX|1|TX|||ECHOCARDIOGRAPHIC REPORT||||||F|||202101010000|||\n"
Expand Down Expand Up @@ -129,7 +128,7 @@ public void testPprPc1ServiceRequestPresentDocumentReferenceDetails() throws IOE

DocumentReference documentRef = ResourceUtils.getResourceDocumentReference(documentRefResource.get(0), context);
DocumentReference.DocumentReferenceContextComponent drContext = documentRef.getContext();
assertThat(drContext.getPeriod().getStartElement().toString()).containsPattern("2018-01-18T03:47:00"); // OBR.7
assertThat(drContext.hasPeriod()).isFalse();
DocumentReference.DocumentReferenceContentComponent content = documentRef.getContentFirstRep();
assertThat(content.getAttachment().getContentType()).isEqualTo("text/plain"); // Currently always defaults to text/plain
assertThat(content.getAttachment().getCreation()).isNull(); // No TXA.7 in message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ public void docRefContextAndServiceRequestPresenceTest(String segment) {
// ORC required for ServiceRequest test
// All three practitioner id's are provided (ORC.2, ORC.3, ORC.456)
+ "ORC|NW|P1005|F1005|PGN001|SC|D|1|||MS|MS|||||\n"
// OBR.24 converts to DocumentReference.practiceSetting
+ "OBR|1||||||20170825010500|||||||||||||002||||CUS|F||||||||\n"
// TXA.4 used for context start
+ "TXA|1||TEXT|20180117144200|5566^PAPLast^PAPFirst^J^^MD||201801180346||<PHYSID1>||||||||||AV|||<PHYSID2>||\n"
// OBX is type ST so an observation will be created
+ "OBX|1|ST|100||This is content|||||||X\n";
Expand All @@ -215,10 +215,9 @@ public void docRefContextAndServiceRequestPresenceTest(String segment) {
Practitioner practBundle = ResourceUtils.getSpecificPractitionerFromBundle(bundle, requesterRef);

DocumentReference.DocumentReferenceContextComponent refContext = documentReference.getContext();
assertThat(refContext.getPeriod().getStartElement().toString()).containsPattern("2018-01-17T14:42:00");
assertThat(refContext.getPeriod().getStartElement().toString()).containsPattern("2018-01-17T14:42:00"); // TXA.4
assertThat(refContext.hasRelated()).isTrue();
assertThat(refContext.hasPracticeSetting()).isTrue(); // OBR.24
DatatypeUtils.checkCommonCodeableConceptAssertions(refContext.getPracticeSetting(), "CUS", "Cardiac Ultrasound", "http://terminology.hl7.org/CodeSystem/v2-0074", "CUS");
assertThat(refContext.hasPracticeSetting()).isFalse();

assertThat(practBundle.getIdentifierFirstRep().getValue()).isEqualTo("5566");
// Value passed to Context(TXA.5) is used as Identifier value in practitioner
Expand Down

0 comments on commit 5540f46

Please sign in to comment.