edifact_converter 2.0.13 → 2.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -271,6 +271,21 @@
271
271
  </RequisitionInformation>
272
272
  <LaboratoryResults>
273
273
  <GeneralResultInformation>
274
+ <ReportStatusCode>
275
+ <xsl:variable name="SStatC" select="$S02LetterInfo/STS/Elm[2]/SubElm[1]"/>
276
+ <xsl:choose>
277
+ <xsl:when test="$SStatC='K'">komplet_svar</xsl:when>
278
+ <xsl:when test="$SStatC='D'">del_svar</xsl:when>
279
+ <xsl:when test="$SStatC='M'">modtaget</xsl:when>
280
+ <xsl:otherwise>
281
+ <xsl:call-template name="Error">
282
+ <xsl:with-param name="Node" select="$SStatC"/>
283
+ <xsl:with-param name="Text">Kan ikke overætte fra STATUS:<xsl:value-of select="$SStatC"/> til ReportStatusCode
284
+ </xsl:with-param>
285
+ </xsl:call-template>
286
+ </xsl:otherwise>
287
+ </xsl:choose>
288
+ </ReportStatusCode>
274
289
  <ResultStatusCode>
275
290
  <xsl:variable name="RStatC" select="$S18Table/GIS/Elm[1]/SubElm[1]"/>
276
291
  <xsl:variable name="RServC" select="$S18Table/STS/Elm[2]/SubElm[1]"/>
@@ -294,21 +309,6 @@
294
309
  <xsl:value-of select="Elm[1]/SubElm[2]"/>
295
310
  </ToLabIdentifier>
296
311
  </xsl:for-each>
297
- <ReportStatusCode>
298
- <xsl:variable name="SStatC" select="$S02LetterInfo/STS/Elm[2]/SubElm[1]"/>
299
- <xsl:choose>
300
- <xsl:when test="$SStatC='K'">komplet_svar</xsl:when>
301
- <xsl:when test="$SStatC='D'">del_svar</xsl:when>
302
- <xsl:when test="$SStatC='M'">modtaget</xsl:when>
303
- <xsl:otherwise>
304
- <xsl:call-template name="Error">
305
- <xsl:with-param name="Node" select="$SStatC"/>
306
- <xsl:with-param name="Text">Kan ikke overætte fra STATUS:<xsl:value-of select="$SStatC"/> til ReportStatusCode
307
- </xsl:with-param>
308
- </xsl:call-template>
309
- </xsl:otherwise>
310
- </xsl:choose>
311
- </ReportStatusCode>
312
312
 
313
313
  <!--
314
314
  <xsl:for-each select="$S18Table/GIS">
@@ -268,6 +268,21 @@
268
268
  </RequisitionInformation>
269
269
  <LaboratoryResults>
270
270
  <GeneralResultInformation>
271
+ <ReportStatusCode>
272
+ <xsl:variable name="SStatC" select="$S02LetterInfo/STS/Elm[2]/SubElm[1]"/>
273
+ <xsl:choose>
274
+ <xsl:when test="$SStatC='K'">komplet_svar</xsl:when>
275
+ <xsl:when test="$SStatC='D'">del_svar</xsl:when>
276
+ <xsl:when test="$SStatC='M'">modtaget</xsl:when>
277
+ <xsl:otherwise>
278
+ <xsl:call-template name="Error">
279
+ <xsl:with-param name="Node" select="$SStatC"/>
280
+ <xsl:with-param name="Text">Kan ikke overætte fra STATUS:<xsl:value-of select="$SStatC"/> til ReportStatusCode
281
+ </xsl:with-param>
282
+ </xsl:call-template>
283
+ </xsl:otherwise>
284
+ </xsl:choose>
285
+ </ReportStatusCode>
271
286
  <ResultStatusCode>
272
287
  <xsl:variable name="RStatC" select="$S18Table/GIS/Elm[1]/SubElm[1]"/>
273
288
  <xsl:variable name="RServC" select="$S18Table/STS/Elm[2]/SubElm[1]"/>
@@ -291,21 +306,6 @@
291
306
  <xsl:value-of select="Elm[1]/SubElm[2]"/>
292
307
  </ToLabIdentifier>
293
308
  </xsl:for-each>
294
- <ReportStatusCode>
295
- <xsl:variable name="SStatC" select="$S02LetterInfo/STS/Elm[2]/SubElm[1]"/>
296
- <xsl:choose>
297
- <xsl:when test="$SStatC='K'">komplet_svar</xsl:when>
298
- <xsl:when test="$SStatC='D'">del_svar</xsl:when>
299
- <xsl:when test="$SStatC='M'">modtaget</xsl:when>
300
- <xsl:otherwise>
301
- <xsl:call-template name="Error">
302
- <xsl:with-param name="Node" select="$SStatC"/>
303
- <xsl:with-param name="Text">Kan ikke overætte fra STATUS:<xsl:value-of select="$SStatC"/> til ReportStatusCode
304
- </xsl:with-param>
305
- </xsl:call-template>
306
- </xsl:otherwise>
307
- </xsl:choose>
308
- </ReportStatusCode>
309
309
 
310
310
  <!--
311
311
  <xsl:for-each select="$S18Table/GIS">
@@ -21,6 +21,7 @@
21
21
  <xsl:variable name="SampleRecDTM" select="$S04Sample/DTM[Elm[1]/SubElm[1]='8']"/>
22
22
  <xsl:variable name="S06Patient" select="BrevIndhold/S06"/>
23
23
  <xsl:variable name="S07Patient" select="BrevIndhold/S07[PNA/Elm[1]/SubElm[1]='PAT'] "/>
24
+ <xsl:variable name="S07Relative" select="BrevIndhold/S07[PNA/Elm[1]/SubElm[1]='PER'] "/>
24
25
  <xsl:variable name="S10ReqInfo" select="BrevIndhold/S10"/>
25
26
  <xsl:variable name="S16Samples" select="BrevIndhold/S16"/>
26
27
  <xsl:variable name="S18" select="BrevIndhold/S18"/>
@@ -177,12 +178,6 @@
177
178
  </xsl:for-each>
178
179
  </xsl:for-each>
179
180
  <xsl:for-each select="$S06Patient">
180
- <xsl:for-each select="ADR">
181
- <xsl:call-template name="ADRToStreetName"/>
182
- <xsl:call-template name="ADRToSuburbName"/>
183
- <xsl:call-template name="ADRToDistrictName"/>
184
- <xsl:call-template name="ADRToPostCodeIdentifier"/>
185
- </xsl:for-each>
186
181
  <xsl:for-each select="$S07Patient">
187
182
  <xsl:for-each select="HAN">
188
183
  <Consent>
@@ -197,6 +192,18 @@
197
192
  </xsl:for-each>
198
193
  </xsl:for-each>
199
194
  </Patient>
195
+ <xsl:for-each select="$S07Relative">
196
+ <Relative>
197
+ <xsl:for-each select="REL">
198
+ <xsl:call-template name="RELToRelationCode"/>
199
+ </xsl:for-each>
200
+ <xsl:for-each select="PNA">
201
+ <xsl:call-template name="PNAToPersonIdentifier"/>
202
+ <xsl:call-template name="PNAToPersonSurnameName"/>
203
+ <xsl:call-template name="PNAToPersonGivenName"/>
204
+ </xsl:for-each>
205
+ </Relative>
206
+ </xsl:for-each>
200
207
  <RequisitionInformation>
201
208
  <xsl:for-each select="$DocRekvNrRFF">
202
209
  <RequestersRequisitionIdentifier>
@@ -249,6 +256,21 @@
249
256
  </RequisitionInformation>
250
257
  <LaboratoryResults>
251
258
  <GeneralResultInformation>
259
+ <ReportStatusCode>
260
+ <xsl:variable name="SStatC" select="$S02LetterInfo/STS/Elm[2]/SubElm[1]"/>
261
+ <xsl:choose>
262
+ <xsl:when test="$SStatC='K'">komplet_svar</xsl:when>
263
+ <xsl:when test="$SStatC='D'">del_svar</xsl:when>
264
+ <xsl:when test="$SStatC='M'">modtaget</xsl:when>
265
+ <xsl:otherwise>
266
+ <xsl:call-template name="Error">
267
+ <xsl:with-param name="Node" select="$SStatC"/>
268
+ <xsl:with-param name="Text">Kan ikke overætte fra STATUS:<xsl:value-of select="$SStatC"/> til ReportStatusCode
269
+ </xsl:with-param>
270
+ </xsl:call-template>
271
+ </xsl:otherwise>
272
+ </xsl:choose>
273
+ </ReportStatusCode>
252
274
  <ResultStatusCode>
253
275
  <xsl:variable name="RStatC" select="$S18Table/GIS/Elm[1]/SubElm[1]"/>
254
276
  <xsl:variable name="RServC" select="$S18Table/STS/Elm[2]/SubElm[1]"/>
@@ -272,21 +294,7 @@
272
294
  <xsl:value-of select="Elm[1]/SubElm[2]"/>
273
295
  </ToLabIdentifier>
274
296
  </xsl:for-each>
275
- <ReportStatusCode>
276
- <xsl:variable name="SStatC" select="$S02LetterInfo/STS/Elm[2]/SubElm[1]"/>
277
- <xsl:choose>
278
- <xsl:when test="$SStatC='K'">komplet_svar</xsl:when>
279
- <xsl:when test="$SStatC='D'">del_svar</xsl:when>
280
- <xsl:when test="$SStatC='M'">modtaget</xsl:when>
281
- <xsl:otherwise>
282
- <xsl:call-template name="Error">
283
- <xsl:with-param name="Node" select="$SStatC"/>
284
- <xsl:with-param name="Text">Kan ikke overætte fra STATUS:<xsl:value-of select="$SStatC"/> til ReportStatusCode
285
- </xsl:with-param>
286
- </xsl:call-template>
287
- </xsl:otherwise>
288
- </xsl:choose>
289
- </ReportStatusCode>
297
+
290
298
  <xsl:for-each select="$S02Answer/DTM">
291
299
  <ResultsDateTime>
292
300
  <xsl:call-template name="DTM203ToDateTime"/>
@@ -321,6 +329,20 @@
321
329
  </CodedFormat>
322
330
  <xsl:for-each select="$S18Table">
323
331
  <TableFormat>
332
+ <xsl:for-each select="INV[Elm[1]/SubElm[1]='MQ']">
333
+ <xsl:if test="Elm[2]/SubElm[1]!='' ">
334
+ <AnalysisCode>
335
+ <xsl:value-of select="Elm[2]/SubElm[1]"/>
336
+ </AnalysisCode>
337
+ </xsl:if>
338
+ </xsl:for-each>
339
+ <xsl:for-each select="FTX[Elm[1]/SubElm[1]='ACM']">
340
+ <AnalysisCompleteName>
341
+ <xsl:call-template name="FTXSegmentsToFormattedText">
342
+ <xsl:with-param name="FTXSegments" select="."/>
343
+ </xsl:call-template>
344
+ </AnalysisCompleteName>
345
+ </xsl:for-each>
324
346
  <xsl:for-each select="INV">
325
347
  <ResultHeadline>
326
348
  <xsl:value-of select="Elm[2]/SubElm[4]"/>
@@ -88,8 +88,8 @@
88
88
  <xsl:when test="$IC='lokationsnummer' "></xsl:when>
89
89
  <xsl:when test="count($IC)=0 "/>
90
90
  <xsl:when test="$IC='kommunenummer' ">KOM</xsl:when>
91
- <xsl:when test="$IC='sorkode'">SOR</xsl:when>
92
- <xsl:otherwise>
91
+ <xsl:when test="$IC='sorkode'">SOR</xsl:when>
92
+ <xsl:otherwise>
93
93
  <FEJL>Kan ikke oversætte IdentifierCodeType: <xsl:value-of select="$IC"/>
94
94
  </FEJL>
95
95
  </xsl:otherwise>
@@ -103,8 +103,8 @@
103
103
  <xsl:when test="$IC='lokationsnummer' ">9</xsl:when>
104
104
  <xsl:when test="count($IC)=0 ">9</xsl:when>
105
105
  <xsl:when test="$IC='kommunenummer' ">IM</xsl:when>
106
- <xsl:when test="$IC='sorkode'">SST</xsl:when>
107
- <xsl:otherwise>
106
+ <xsl:when test="$IC='sorkode'">SST</xsl:when>
107
+ <xsl:otherwise>
108
108
  <FEJL>Kan ikke oversætte IdentifierCodeType: <xsl:value-of select="$IC"/>
109
109
  </FEJL>
110
110
  </xsl:otherwise>
@@ -188,8 +188,8 @@
188
188
  <xsl:when test="$IC='lokationsnummer' "></xsl:when>
189
189
  <xsl:when test="count($IC)=0"/>
190
190
  <xsl:when test="$IC='kommunenummer' ">KOM</xsl:when>
191
- <xsl:when test="$IC='sorkode'">SOR</xsl:when>
192
- <xsl:otherwise>
191
+ <xsl:when test="$IC='sorkode'">SOR</xsl:when>
192
+ <xsl:otherwise>
193
193
  <FEJL>Kan ikke oversætte IdentifierCodeType: <xsl:value-of select="$IC"/>
194
194
  </FEJL>
195
195
  </xsl:otherwise>
@@ -203,8 +203,8 @@
203
203
  <xsl:when test="$IC='lokationsnummer' ">9</xsl:when>
204
204
  <xsl:when test="count($IC)=0">9</xsl:when>
205
205
  <xsl:when test="$IC='kommunenummer' ">IM</xsl:when>
206
- <xsl:when test="$IC='sorkode'">SST</xsl:when>
207
- <xsl:otherwise>
206
+ <xsl:when test="$IC='sorkode'">SST</xsl:when>
207
+ <xsl:otherwise>
208
208
  <FEJL>Kan ikke oversætte IdentifierCodeType: <xsl:value-of select="$IC"/>
209
209
  </FEJL>
210
210
  </xsl:otherwise>
@@ -285,8 +285,8 @@
285
285
  <xsl:when test="$IC='lokationsnummer' "></xsl:when>
286
286
  <xsl:when test="count($IC)=0 "/>
287
287
  <xsl:when test="$IC='kommunenummer' ">KOM</xsl:when>
288
- <xsl:when test="$IC='sorkode'">SOR</xsl:when>
289
- <xsl:otherwise>
288
+ <xsl:when test="$IC='sorkode'">SOR</xsl:when>
289
+ <xsl:otherwise>
290
290
  <FEJL>Kan ikke oversætte IdentifierCodeType: <xsl:value-of select="$IC"/>
291
291
  </FEJL>
292
292
  </xsl:otherwise>
@@ -300,8 +300,8 @@
300
300
  <xsl:when test="$IC='lokationsnummer' ">9</xsl:when>
301
301
  <xsl:when test="count($IC)=0 ">9</xsl:when>
302
302
  <xsl:when test="$IC='kommunenummer' ">IM</xsl:when>
303
- <xsl:when test="$IC='sorkode'">SST</xsl:when>
304
- <xsl:otherwise>
303
+ <xsl:when test="$IC='sorkode'">SST</xsl:when>
304
+ <xsl:otherwise>
305
305
  <FEJL>Kan ikke oversætte IdentifierCodeType: <xsl:value-of select="$IC"/>
306
306
  </FEJL>
307
307
  </xsl:otherwise>
@@ -806,16 +806,6 @@
806
806
  </FEJL>
807
807
  </xsl:otherwise>
808
808
  </xsl:choose>
809
- <!--
810
- <xsl:variable name="RSC" select="$GeneralResultInformation/m:ResultsServiceCode"/>
811
- <xsl:choose>
812
- <xsl:when test="$RSC='nyt' ">N</xsl:when>
813
- <xsl:when test="$RSC='rettet' ">M</xsl:when>
814
- <xsl:otherwise>
815
- <FEJL>ukendt ResultServiceCode: <xsl:value-of select="$RSC"/>
816
- </FEJL>
817
- </xsl:otherwise>
818
- </xsl:choose>-->
819
809
  </SubElm>
820
810
  </Elm>
821
811
  </GIS>
@@ -873,18 +863,6 @@
873
863
  </FEJL>
874
864
  </xsl:otherwise>
875
865
  </xsl:choose>
876
-
877
- <!--
878
- <xsl:variable name="RSC" select="$GeneralResultInformation/m:ResultsStatusCode"/>
879
- <xsl:choose>
880
- <xsl:when test="$RSC='endeligt' ">FR</xsl:when>
881
- <xsl:when test="$RSC='foreloebigt' ">PR</xsl:when>
882
- <xsl:otherwise>
883
- <FEJL>ukendt ResultStatusCode: <xsl:value-of select="$RSC"/>
884
- </FEJL>
885
- </xsl:otherwise>
886
- </xsl:choose>
887
- -->
888
866
  </SubElm>
889
867
  </Elm>
890
868
  </STS>
@@ -901,118 +879,112 @@
901
879
  </S18>
902
880
  <xsl:for-each select="$Samples">
903
881
  <xsl:variable name="pos" select="position()"/>
904
- <S18 hidden="true">
905
- <GIS>
906
- <Elm>
907
- <SubElm>N</SubElm>
908
- </Elm>
909
- </GIS>
910
- <xsl:if test="$pos=1">
911
- <INV>
912
- <Elm>
913
- <SubElm>OE</SubElm>
914
- </Elm>
915
- <Elm>
916
- <SubElm/>
917
- <SubElm/>
918
- <SubElm/>
919
- <SubElm>
920
- <xsl:value-of select="$CodedFormat/m:DiagnosisHeadline"/>
921
- </SubElm>
922
- </Elm>
923
- </INV>
924
- </xsl:if>
925
- <!--
926
- <INV>
927
- <Elm>
928
- <SubElm>OE</SubElm>
929
- </Elm>
930
- <Elm>
931
- <SubElm/>
932
- <SubElm/>
933
- <SubElm/>
934
- <SubElm>
935
- <xsl:value-of select="m:CodedResults/m:Headline"/>
936
- </SubElm>
937
- </Elm>
938
- </INV>-->
939
- </S18>
940
- <S18 hidden="true">
941
- <GIS>
942
- <Elm>
943
- <SubElm>N</SubElm>
944
- </Elm>
945
- </GIS>
946
- <xsl:for-each select="m:CodedResults/m:Topography">
947
- <CIN>
882
+ <xsl:variable name="DiagOvs" select="$CodedFormat/m:DiagnosisHeadline"/>
883
+ <xsl:variable name="CodedRes" select="$CodedFormat/m:Sample/m:CodedResults"/>
884
+
885
+ <xsl:if test="$DiagOvs!=''">
886
+ <S18 hidden="true">
887
+ <GIS>
948
888
  <Elm>
949
- <SubElm>CCI</SubElm>
889
+ <SubElm>N</SubElm>
950
890
  </Elm>
951
- <Elm>
952
- <SubElm>
953
- <xsl:value-of select="m:Code"/>
954
- </SubElm>
955
- <SubElm>SNO</SubElm>
956
- <SubElm>SST</SubElm>
957
- <SubElm>
958
- <xsl:value-of select="m:Text"/>
959
- </SubElm>
960
- </Elm>
961
- </CIN>
962
- <xsl:if test="count(m:Comment)=1">
963
- <CIN>
891
+ </GIS>
892
+ <xsl:if test="$pos=1">
893
+ <INV>
964
894
  <Elm>
965
- <SubElm>SPC</SubElm>
895
+ <SubElm>OE</SubElm>
966
896
  </Elm>
967
897
  <Elm>
968
898
  <SubElm/>
969
899
  <SubElm/>
970
900
  <SubElm/>
971
901
  <SubElm>
972
- <xsl:value-of select="m:Comment"/>
902
+ <xsl:value-of select="$DiagOvs"/>
973
903
  </SubElm>
974
904
  </Elm>
975
- </CIN>
905
+ </INV>
976
906
  </xsl:if>
977
- </xsl:for-each>
978
- <xsl:for-each select="m:CodedResults/m:Result">
979
- <CIN>
980
- <Elm>
981
- <SubElm>CCI</SubElm>
982
- </Elm>
907
+ </S18>
908
+ </xsl:if>
909
+
910
+ <xsl:if test="$CodedRes!=''">
911
+ <S18 hidden="true">
912
+ <GIS>
983
913
  <Elm>
984
- <SubElm>
985
- <xsl:value-of select="m:Code"/>
986
- </SubElm>
987
- <SubElm>SNO</SubElm>
988
- <SubElm>SST</SubElm>
989
- <SubElm>
990
- <xsl:value-of select="m:Text"/>
991
- </SubElm>
914
+ <SubElm>N</SubElm>
992
915
  </Elm>
993
- </CIN>
994
- <xsl:if test="count(m:Comment)=1">
916
+ </GIS>
917
+ <xsl:for-each select="m:CodedResults/m:Topography">
995
918
  <CIN>
996
919
  <Elm>
997
- <SubElm>SPC</SubElm>
920
+ <SubElm>CCI</SubElm>
998
921
  </Elm>
999
922
  <Elm>
1000
- <SubElm/>
1001
- <SubElm/>
1002
- <SubElm/>
1003
923
  <SubElm>
1004
- <xsl:value-of select="m:Comment"/>
924
+ <xsl:value-of select="m:Code"/>
925
+ </SubElm>
926
+ <SubElm>SNO</SubElm>
927
+ <SubElm>SST</SubElm>
928
+ <SubElm>
929
+ <xsl:value-of select="m:Text"/>
1005
930
  </SubElm>
1006
931
  </Elm>
1007
932
  </CIN>
1008
- </xsl:if>
1009
- </xsl:for-each>
1010
- <INV>
1011
- <Elm>
1012
- <SubElm>NR</SubElm>
1013
- </Elm>
1014
- </INV>
1015
- </S18>
933
+ <xsl:if test="count(m:Comment)=1">
934
+ <CIN>
935
+ <Elm>
936
+ <SubElm>SPC</SubElm>
937
+ </Elm>
938
+ <Elm>
939
+ <SubElm/>
940
+ <SubElm/>
941
+ <SubElm/>
942
+ <SubElm>
943
+ <xsl:value-of select="m:Comment"/>
944
+ </SubElm>
945
+ </Elm>
946
+ </CIN>
947
+ </xsl:if>
948
+ </xsl:for-each>
949
+ <xsl:for-each select="m:CodedResults/m:Result">
950
+ <CIN>
951
+ <Elm>
952
+ <SubElm>CCI</SubElm>
953
+ </Elm>
954
+ <Elm>
955
+ <SubElm>
956
+ <xsl:value-of select="m:Code"/>
957
+ </SubElm>
958
+ <SubElm>SNO</SubElm>
959
+ <SubElm>SST</SubElm>
960
+ <SubElm>
961
+ <xsl:value-of select="m:Text"/>
962
+ </SubElm>
963
+ </Elm>
964
+ </CIN>
965
+ <xsl:if test="count(m:Comment)=1">
966
+ <CIN>
967
+ <Elm>
968
+ <SubElm>SPC</SubElm>
969
+ </Elm>
970
+ <Elm>
971
+ <SubElm/>
972
+ <SubElm/>
973
+ <SubElm/>
974
+ <SubElm>
975
+ <xsl:value-of select="m:Comment"/>
976
+ </SubElm>
977
+ </Elm>
978
+ </CIN>
979
+ </xsl:if>
980
+ </xsl:for-each>
981
+ <INV>
982
+ <Elm>
983
+ <SubElm>NR</SubElm>
984
+ </Elm>
985
+ </INV>
986
+ </S18>
987
+ </xsl:if>
1016
988
  </xsl:for-each>
1017
989
  <xsl:for-each select="$Macroscopic">
1018
990
  <S18 hidden="true">
@@ -1225,4 +1197,5 @@
1225
1197
  </UNT>
1226
1198
  </Brev>
1227
1199
  </xsl:template>
1200
+
1228
1201
  </xsl:stylesheet>