Skip to content

Commit 9b4f36c

Browse files
committed
Update ORM mappings (#16299)
* Create ORM integration tests * Adding ORM Java classes * Updating ORM/OML Mappings * Updating existing configuration tests with newly available fhir mappings * Accidentally left a comment in * And another one * Updating code comment with issue link * Order Detail Segment comment
1 parent e560ca8 commit 9b4f36c

File tree

18 files changed

+10453
-1514
lines changed

18 files changed

+10453
-1514
lines changed

prime-router/build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,7 @@ dependencies {
907907
implementation("ca.uhn.hapi.fhir:org.hl7.fhir.r4:6.3.24")
908908
implementation("ca.uhn.hapi:hapi-base:2.5.1")
909909
implementation("ca.uhn.hapi:hapi-structures-v251:2.5.1")
910+
implementation("ca.uhn.hapi:hapi-structures-v26:2.5.1")
910911
implementation("ca.uhn.hapi:hapi-structures-v27:2.5.1")
911912
implementation("com.googlecode.libphonenumber:libphonenumber:8.13.46")
912913
implementation("org.thymeleaf:thymeleaf:3.1.2.RELEASE")

prime-router/metadata/HL7/catchall/hl7/message/OML_O21.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ resources:
4949
- .PV2
5050
- MSH
5151

52-
- resourceName: OMLObservation
52+
- resourceName: OrderObservation
5353
segment: .OBSERVATION_REQUEST.OBSERVATION.OBX
5454
group: ORDER
5555
resourcePath: segments/OBX/Observation

prime-router/metadata/HL7/catchall/hl7/message/ORM_O01.yml

+31-19
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,38 @@ resources:
88
repeats: false
99
isReferenced: false
1010

11+
- resourceName: Provenance
12+
segment: MSH
13+
resourcePath: segments/MSH/Provenance-Source
14+
15+
- resourceName: Provenance
16+
segment: MSH
17+
resourcePath: segments/MSH/Provenance-Transformation
18+
1119
- resourceName: Patient
1220
segment: .PID
1321
group: PATIENT
1422
resourcePath: segments/PID/Patient
1523
isReferenced: true
1624
repeats: false
25+
additionalSegments:
26+
- .PD1
27+
- .NTE
1728

18-
- resourceName: ServiceRequest
19-
segment: .ORC
20-
group: ORDER
21-
resourcePath: segments/ORC/ServiceRequest
22-
repeats: true
29+
- resourceName: Provenance
30+
segment: .PID
31+
group: PATIENT
32+
resourcePath: segments/PID/Provenance-Patient
33+
34+
- resourceName: Encounter
35+
segment: .PV1
36+
group: PATIENT.PATIENT_VISIT
37+
resourcePath: segments/PV1/Encounter
2338
isReferenced: true
2439
additionalSegments:
25-
- .ORDER_DETAIL.OBR
26-
- .ORDER_DETAIL.NTE
27-
- PATIENT.PATIENT_VISIT.PV1
28-
- MSH
29-
- PATIENT.PID
40+
- .PV2
3041

31-
- resourceName: Observation
42+
- resourceName: OrderObservation
3243
segment: .ORDER_DETAIL.OBSERVATION.OBX
3344
group: ORDER
3445
resourcePath: segments/OBX/Observation
@@ -38,15 +49,16 @@ resources:
3849
- .ORC
3950
- .ORDER_DETAIL.OBR
4051
- .ORDER_DETAIL.OBSERVATION.NTE
41-
- MSH
4252

43-
- resourceName: Specimen
44-
segment: .OBR
45-
group: ORDER.ORDER_DETAIL
46-
resourcePath: segments/SPM/Specimen
53+
- resourceName: ServiceRequest
54+
segment: .ORC
55+
group: ORDER
56+
resourcePath: segments/ORC/ServiceRequest
4757
repeats: true
4858
isReferenced: true
4959
additionalSegments:
50-
- .OBSERVATION.OBX
51-
- .OBSERVATION.NTE
52-
- MSH
60+
- .ORDER_DETAIL.OBR
61+
- .ORDER_DETAIL.NTE
62+
- PATIENT.PATIENT_VISIT.PV1
63+
- PATIENT.PID
64+
- .ORDER_DETAIL.OBSERVATION.OBX

prime-router/metadata/HL7/catchall/hl7/segments/OBX/Observation.yml

-8
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ resourceType: Observation
1010
# OBX.18 is repeatable but maps to device on Observation which is not, so it's all captured in OBXExtension
1111
# OBX.20 is repeatable but maps to bodySite on Observation which is not, so it's all captured in OBXExtension
1212
# Not implementing OBX.22 not in mapping deprecated in NIST
13-
# Not implementing OBX.26 not in mapping not in NIST
14-
# Not implementing OBX.27 not in mapping not in NIST
15-
# Not implementing OBX.28 not in mapping not in NIST
16-
# Not implementing OBX.29 not in mapping not in NIST
17-
# Not implementing OBX.31 not in mapping not in NIST
18-
# Not implementing OBX.32 not in mapping not in NIST
19-
# Not implementing OBX.33 as it's not in the NIST spec the logic in the inventory cannot be implemented in the library
20-
2113

2214
id:
2315
type: STRING

prime-router/metadata/HL7/catchall/hl7/segments/ORC/ServiceRequest.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ supportingInfo:
366366
generateList: true
367367
valueOf: datatype/Reference
368368
expressionType: resource
369-
specs: $OMLObservation
369+
specs: $OrderObservation
370370
useGroup: true
371371

372372
note:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
/*
2+
* This class is an auto-generated source file for a HAPI
3+
* HL7 v2.x standard structure class.
4+
*
5+
* For more information, visit: http://hl7api.sourceforge.net/
6+
*
7+
* The contents of this file are subject to the Mozilla Public License Version 1.1
8+
* (the "License"); you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at http://www.mozilla.org/MPL/
10+
* Software distributed under the License is distributed on an "AS IS" basis,
11+
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the
12+
* specific language governing rights and limitations under the License.
13+
*
14+
* The Original Code is "[file_name]". Description:
15+
* "[one_line_description]"
16+
*
17+
* The Initial Developer of the Original Code is University Health Network. Copyright (C)
18+
* 2012. All Rights Reserved.
19+
*
20+
* Contributor(s): ______________________________________.
21+
*
22+
* Alternatively, the contents of this file may be used under the terms of the
23+
* GNU General Public License (the "GPL"), in which case the provisions of the GPL are
24+
* applicable instead of those above. If you wish to allow use of your version of this
25+
* file only under the terms of the GPL and not to allow others to use your version
26+
* of this file under the MPL, indicate your decision by deleting the provisions above
27+
* and replace them with the notice and other provisions required by the GPL License.
28+
* If you do not delete the provisions above, a recipient may use your version of
29+
* this file under either the MPL or the GPL.
30+
*
31+
*/
32+
33+
package fhirengine.translation.hl7.structures.fhirinventory.group;
34+
35+
import ca.uhn.hl7v2.HL7Exception;
36+
import ca.uhn.hl7v2.parser.ModelClassFactory;
37+
import ca.uhn.hl7v2.model.*;
38+
import fhirengine.translation.hl7.structures.fhirinventory.segment.NTE;
39+
import fhirengine.translation.hl7.structures.fhirinventory.segment.OBX;
40+
41+
/**
42+
* <p>Represents a ORM_O01_OBSERVATION group structure (a Group object).
43+
* A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
44+
* This Group contains the following elements:
45+
* </p>
46+
* <ul>
47+
* <li>1: OBX (Observation/Result) <b> </b></li>
48+
* <li>2: NTE (Notes and Comments) <b>optional repeating </b></li>
49+
* </ul>
50+
*/
51+
//@SuppressWarnings("unused")
52+
public class ORM_O01_OBSERVATION extends AbstractGroup {
53+
54+
/**
55+
* Creates a new ORM_O01_OBSERVATION group
56+
*/
57+
public ORM_O01_OBSERVATION(Group parent, ModelClassFactory factory) {
58+
super(parent, factory);
59+
init(factory);
60+
}
61+
62+
private void init(ModelClassFactory factory) {
63+
try {
64+
this.add(OBX.class, true, false, false);
65+
this.add(NTE.class, false, true, false);
66+
} catch(HL7Exception e) {
67+
log.error("Unexpected error creating ORM_O01_OBSERVATION - this is probably a bug in the source code generator.", e);
68+
}
69+
}
70+
71+
/**
72+
* Returns "2.7"
73+
*/
74+
public String getVersion() {
75+
return "2.7";
76+
}
77+
78+
/**
79+
* Returns
80+
* OBX (Observation/Result) - creates it if necessary
81+
*/
82+
public OBX getOBX() {
83+
OBX retVal = getTyped("OBX", OBX.class);
84+
return retVal;
85+
}
86+
87+
/**
88+
* Returns
89+
* the first repetition of
90+
* NTE (Notes and Comments) - creates it if necessary
91+
*/
92+
public NTE getNTE() {
93+
NTE retVal = getTyped("NTE", NTE.class);
94+
return retVal;
95+
}
96+
97+
/**
98+
* Returns a specific repetition of
99+
* NTE (Notes and Comments) - creates it if necessary
100+
*
101+
* @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
102+
* @throws HL7Exception if the repetition requested is more than one
103+
* greater than the number of existing repetitions.
104+
*/
105+
public NTE getNTE(int rep) {
106+
NTE retVal = getTyped("NTE", rep, NTE.class);
107+
return retVal;
108+
}
109+
110+
/**
111+
* Returns the number of existing repetitions of NTE
112+
*/
113+
public int getNTEReps() {
114+
return getReps("NTE");
115+
}
116+
117+
/**
118+
* <p>
119+
* Returns a non-modifiable List containing all current existing repetitions of NTE.
120+
* <p>
121+
* Note that unlike {@link #getNTE()}, this method will not create any reps
122+
* if none are already present, so an empty list may be returned.
123+
* </p>
124+
*/
125+
public java.util.List<NTE> getNTEAll() throws HL7Exception {
126+
return getAllAsList("NTE", NTE.class);
127+
}
128+
129+
/**
130+
* Inserts a specific repetition of NTE (Notes and Comments)
131+
* @see AbstractGroup#insertRepetition(Structure, int)
132+
*/
133+
public void insertNTE(NTE structure, int rep) throws HL7Exception {
134+
super.insertRepetition("NTE", structure, rep);
135+
}
136+
137+
/**
138+
* Inserts a specific repetition of NTE (Notes and Comments)
139+
* @see AbstractGroup#insertRepetition(Structure, int)
140+
*/
141+
public NTE insertNTE(int rep) throws HL7Exception {
142+
return (NTE)super.insertRepetition("NTE", rep);
143+
}
144+
145+
/**
146+
* Removes a specific repetition of NTE (Notes and Comments)
147+
* @see AbstractGroup#removeRepetition(String, int)
148+
*/
149+
public NTE removeNTE(int rep) throws HL7Exception {
150+
return (NTE)super.removeRepetition("NTE", rep);
151+
}
152+
}

0 commit comments

Comments
 (0)