-
Notifications
You must be signed in to change notification settings - Fork 4
/
FEMA - CSV to MeasureReport Bundle.xml
5074 lines (5015 loc) · 378 KB
/
FEMA - CSV to MeasureReport Bundle.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<channel version="3.9.0">
<id>fbd897e1-b661-490a-b546-275f48e43f7d</id>
<nextMetaDataId>2</nextMetaDataId>
<name>FEMA - CSV to MeasureReport Bundle</name>
<description>Converts the FEMA Measures CSV to a MeasureReport Bundle resource
Input Example:
4/20/20,,,,,,,,,
Data Element,New Diagnostic Tests Ordered/Received,Cumulative Diagnostic Tests Ordered/Recieved ,New Tests Resulted,Cumulative Specimens Rejected*,Cumulative Tests Performed,New Positive COVID-19 Tests,Cumulative Positive COVID-19 Tests,Percent Positive among Newly Resulted Tests,Cumulative Percent Positive among Resulted Tests
Definition,"Midnight to midnight cutoff, tests ordered on previous date queried",All tests ordered to date.,"Midnight to midnight cutoff, test results released on previous date queried",All specimens rejected for testing to date,All tests with results released to date,"Midnight to midnight cutoff, positive test results released on previous date queried",All positive test results released to date,# of new positive test results released / # of total new tests released for previous date queried,# of total positive results to released date / # of total tests results released to date
PA," 10,000 "," 55,000 "," 5,600 ", 777 ," 47,987 "," 1,796 "," 22,018 ",8.2%,40.0%
Allegheney," 1,200 "," 7,789 ", 900 , 22 ," 6,986 ", 134 ," 2,500 ",5.4%,32.1%
</description>
<revision>1</revision>
<sourceConnector version="3.9.0">
<metaDataId>0</metaDataId>
<name>sourceConnector</name>
<properties class="com.mirth.connect.connectors.http.HttpReceiverProperties" version="3.9.0">
<pluginProperties>
<com.mirth.connect.plugins.httpauth.NoneHttpAuthProperties version="3.9.0">
<authType>NONE</authType>
</com.mirth.connect.plugins.httpauth.NoneHttpAuthProperties>
</pluginProperties>
<listenerConnectorProperties version="3.9.0">
<host>0.0.0.0</host>
<port>9007</port>
</listenerConnectorProperties>
<sourceConnectorProperties version="3.9.0">
<responseVariable>d1</responseVariable>
<respondAfterProcessing>true</respondAfterProcessing>
<processBatch>false</processBatch>
<firstResponse>false</firstResponse>
<processingThreads>1</processingThreads>
<resourceIds class="linked-hash-map">
<entry>
<string>Default Resource</string>
<string>[Default Resource]</string>
</entry>
</resourceIds>
<queueBufferSize>1000</queueBufferSize>
</sourceConnectorProperties>
<xmlBody>false</xmlBody>
<parseMultipart>true</parseMultipart>
<includeMetadata>false</includeMetadata>
<binaryMimeTypes>application/.*(?<!json|xml)$|image/.*|video/.*|audio/.*</binaryMimeTypes>
<binaryMimeTypesRegex>true</binaryMimeTypesRegex>
<responseContentType>application/fhir+json</responseContentType>
<responseDataTypeBinary>false</responseDataTypeBinary>
<responseStatusCode></responseStatusCode>
<responseHeaders class="linked-hash-map"/>
<responseHeadersVariable></responseHeadersVariable>
<useResponseHeadersVariable>false</useResponseHeadersVariable>
<charset>UTF-8</charset>
<contextPath></contextPath>
<timeout>30000</timeout>
<staticResources/>
</properties>
<transformer version="3.9.0">
<elements>
<com.mirth.connect.plugins.fhir.shared.FhirModelBuilderTransformerStep version="3.9.0">
<name>Create Subject</name>
<sequenceNumber>0</sequenceNumber>
<enabled>true</enabled>
<storeAsLocal>true</storeAsLocal>
<mapType>CHANNEL</mapType>
<variable>subject</variable>
<definition>Reference</definition>
<model class="com.mirth.connect.jsonbuilder.shared.models.ObjectModel">
<usingBuilder>true</usingBuilder>
<properties class="linked-hash-map">
<entry>
<string>reference</string>
<com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
<enabled>true</enabled>
<properties class="com.mirth.connect.jsonbuilder.shared.models.StringModel">
<stringValue>Location/states-NJ</stringValue>
</properties>
</com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
</entry>
<entry>
<string>identifier</string>
<com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
<enabled>true</enabled>
<properties class="com.mirth.connect.jsonbuilder.shared.models.ObjectModel">
<usingBuilder>true</usingBuilder>
<properties class="linked-hash-map">
<entry>
<string>use</string>
<com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
<enabled>false</enabled>
<properties class="com.mirth.connect.jsonbuilder.shared.models.StringModel">
<stringValue>usual</stringValue>
<usingEnum>true</usingEnum>
</properties>
</com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
</entry>
<entry>
<string>system</string>
<com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
<enabled>true</enabled>
<properties class="com.mirth.connect.jsonbuilder.shared.models.StringModel">
<stringValue>https://www.census.gov/geographies</stringValue>
</properties>
</com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
</entry>
<entry>
<string>value</string>
<com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
<enabled>true</enabled>
<properties class="com.mirth.connect.jsonbuilder.shared.models.StringModel">
<stringValue>34</stringValue>
</properties>
</com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
</entry>
</properties>
</properties>
</com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
</entry>
<entry>
<string>display</string>
<com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
<enabled>true</enabled>
<properties class="com.mirth.connect.jsonbuilder.shared.models.StringModel">
<stringValue>State of New Jersey</stringValue>
</properties>
</com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
</entry>
</properties>
</model>
<fhirVersion>R4</fhirVersion>
</com.mirth.connect.plugins.fhir.shared.FhirModelBuilderTransformerStep>
<com.mirth.connect.plugins.fhir.shared.FhirModelBuilderTransformerStep version="3.9.0">
<name>Create Reporter</name>
<sequenceNumber>1</sequenceNumber>
<enabled>true</enabled>
<storeAsLocal>true</storeAsLocal>
<mapType>CHANNEL</mapType>
<variable>reporter</variable>
<definition>Reference</definition>
<model class="com.mirth.connect.jsonbuilder.shared.models.ObjectModel">
<usingBuilder>true</usingBuilder>
<properties class="linked-hash-map">
<entry>
<string>reference</string>
<com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
<enabled>true</enabled>
<properties class="com.mirth.connect.jsonbuilder.shared.models.StringModel">
<stringValue>Organization/NJ-DPH</stringValue>
</properties>
</com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
</entry>
<entry>
<string>display</string>
<com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
<enabled>true</enabled>
<properties class="com.mirth.connect.jsonbuilder.shared.models.StringModel">
<stringValue>New Jersey Department of Public Health</stringValue>
</properties>
</com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
</entry>
</properties>
</model>
<fhirVersion>R4</fhirVersion>
</com.mirth.connect.plugins.fhir.shared.FhirModelBuilderTransformerStep>
<com.mirth.connect.plugins.javascriptstep.JavaScriptStep version="3.9.0">
<name>Get headers and remove them from message</name>
<sequenceNumber>2</sequenceNumber>
<enabled>true</enabled>
<script>var dateRow = msg['row'][0];
var date = dateRow['dataElement'].toString();
var convertedDate = convertDate(getDate(date), 'yyyy-MM-dd');
delete msg['row'][0];
var headerRow1 = msg['row'][0];
var headerRow2 = msg['row'][1];
delete msg['row'][0];
delete msg['row'][0];</script>
</com.mirth.connect.plugins.javascriptstep.JavaScriptStep>
<com.mirth.connect.plugins.javascriptstep.JavaScriptStep version="3.9.0">
<name>Create MeasureReport Bundle resource</name>
<sequenceNumber>3</sequenceNumber>
<enabled>true</enabled>
<script>// Create Bundle_Entry list with MeasureReport resources contained in them
var bundleEntries = [];
for (var i = 0; i < msg['row'].length(); i++) {
var dataRow = msg['row'][i];
// Remove commas from numbers
for (var j = 0; j < dataRow.children().length(); j++) {
dataRow.children()[j] = dataRow.children()[j].split(',').join('');
}
// Create Narrative text for MeasureReport resource
var narrativeText = '<div xmlns="http://www.w3.org/1999/xhtml"><p><b>Generated from CSV record(s):</b></p>';
var pre = '<pre>';
pre += SerializerFactory.getSerializer('DELIMITED').fromXML(dateRow);
pre += SerializerFactory.getSerializer('DELIMITED').fromXML(headerRow1);
pre += SerializerFactory.getSerializer('DELIMITED').fromXML(headerRow2);
pre += SerializerFactory.getSerializer('DELIMITED').fromXML(dataRow) + '</pre>';
var table = createTableFromCsvRow(dataRow, [dateRow, headerRow1, headerRow2]);
narrativeText += pre + table + '</div>';
var measureReport = createFEMAMeasureReport(dataRow, convertedDate, subject, reporter, narrativeText)
replaceNullCounts(measureReport);
var bundleEntry = createBundle_Entry(measureReport);
bundleEntries.push(bundleEntry);
}
// Create Bundle that contains the Bundle_Entry list
var bundle = createBundle('collection', bundleEntries);
// Set outgoing message to the Bundle resource
msg = bundle;</script>
</com.mirth.connect.plugins.javascriptstep.JavaScriptStep>
</elements>
<inboundTemplate encoding="base64">NC8yMC8yMCwsLCwsLCwsLApEYXRhIEVsZW1lbnQsTmV3IERpYWdub3N0aWMgVGVzdHMgT3JkZXJl
ZC9SZWNlaXZlZCxDdW11bGF0aXZlIERpYWdub3N0aWMgVGVzdHMgT3JkZXJlZC9SZWNpZXZlZCAs
TmV3IFRlc3RzIFJlc3VsdGVkLEN1bXVsYXRpdmUgU3BlY2ltZW5zIFJlamVjdGVkKixDdW11bGF0
aXZlIFRlc3RzIFBlcmZvcm1lZCxOZXcgUG9zaXRpdmUgQ09WSUQtMTkgVGVzdHMsQ3VtdWxhdGl2
ZSBQb3NpdGl2ZSBDT1ZJRC0xOSBUZXN0cyxQZXJjZW50IFBvc2l0aXZlIGFtb25nIE5ld2x5IFJl
c3VsdGVkIFRlc3RzLEN1bXVsYXRpdmUgUGVyY2VudCBQb3NpdGl2ZSBhbW9uZyBSZXN1bHRlZCBU
ZXN0cwpEZWZpbml0aW9uLCJNaWRuaWdodCB0byBtaWRuaWdodCBjdXRvZmYsIHRlc3RzIG9yZGVy
ZWQgb24gcHJldmlvdXMgZGF0ZSBxdWVyaWVkIixBbGwgdGVzdHMgb3JkZXJlZCB0byBkYXRlLiwi
TWlkbmlnaHQgdG8gbWlkbmlnaHQgY3V0b2ZmLCB0ZXN0IHJlc3VsdHMgcmVsZWFzZWQgb24gcHJl
dmlvdXMgZGF0ZSBxdWVyaWVkIixBbGwgc3BlY2ltZW5zIHJlamVjdGVkIGZvciB0ZXN0aW5nIHRv
IGRhdGUsQWxsIHRlc3RzIHdpdGggcmVzdWx0cyByZWxlYXNlZCB0byBkYXRlLCJNaWRuaWdodCB0
byBtaWRuaWdodCBjdXRvZmYsIHBvc2l0aXZlIHRlc3QgcmVzdWx0cyByZWxlYXNlZCBvbiBwcmV2
aW91cyBkYXRlIHF1ZXJpZWQiLEFsbCBwb3NpdGl2ZSB0ZXN0IHJlc3VsdHMgcmVsZWFzZWQgdG8g
ZGF0ZSwjIG9mIG5ldyBwb3NpdGl2ZSB0ZXN0IHJlc3VsdHMgcmVsZWFzZWQgLyAjIG9mIHRvdGFs
IG5ldyB0ZXN0cyByZWxlYXNlZCBmb3IgcHJldmlvdXMgZGF0ZSBxdWVyaWVkLCMgb2YgdG90YWwg
cG9zaXRpdmUgcmVzdWx0cyB0byByZWxlYXNlZCBkYXRlIC8gIyBvZiB0b3RhbCB0ZXN0cyByZXN1
bHRzIHJlbGVhc2VkIHRvIGRhdGUKUEEsIiAxMCwwMDAgIiwiIDU1LDAwMCAiLCIgNSw2MDAgIiwg
Nzc3ICwiIDQ3LDk4NyAiLCIgMSw3OTYgIiwiIDIyLDAxOCAiLDguMiUsNDAuMCUKQWxsZWdoZW5l
eSwiIDEsMjAwICIsIiA3LDc4OSAiLCA5MDAgLCAyMiAsIiA2LDk4NiAiLCAxMzQgLCIgMiw1MDAg
Iiw1LjQlLDMyLjElCg==</inboundTemplate>
<outboundTemplate encoding="base64"></outboundTemplate>
<inboundDataType>DELIMITED</inboundDataType>
<outboundDataType>FHIR</outboundDataType>
<inboundProperties class="com.mirth.connect.plugins.datatypes.delimited.DelimitedDataTypeProperties" version="3.9.0">
<serializationProperties class="com.mirth.connect.plugins.datatypes.delimited.DelimitedSerializationProperties" version="3.9.0">
<columnDelimiter>,</columnDelimiter>
<recordDelimiter>\n</recordDelimiter>
<quoteToken>"</quoteToken>
<escapeWithDoubleQuote>false</escapeWithDoubleQuote>
<quoteEscapeToken>\</quoteEscapeToken>
<columnNames>
<string>dataElement</string>
<string>newDiagnosticTestsOrderedReceived</string>
<string>cumulativeDiagnosticTestsOrderedReceived</string>
<string>newTestsResulted</string>
<string>cumulativeSpecimensRejected</string>
<string>cumulativeTestsPerformed</string>
<string>newPositiveCovid19Tests</string>
<string>cumulativePositiveCovid19Tests</string>
<string>percentPositiveAmongNewlyResultedTests</string>
<string>cumulativePercentPositiveAmongResultedTests</string>
</columnNames>
<numberedRows>false</numberedRows>
<ignoreCR>true</ignoreCR>
</serializationProperties>
<deserializationProperties class="com.mirth.connect.plugins.datatypes.delimited.DelimitedDeserializationProperties" version="3.9.0">
<columnDelimiter>,</columnDelimiter>
<recordDelimiter>\n</recordDelimiter>
<quoteToken>"</quoteToken>
<escapeWithDoubleQuote>true</escapeWithDoubleQuote>
<quoteEscapeToken>\</quoteEscapeToken>
</deserializationProperties>
<batchProperties class="com.mirth.connect.plugins.datatypes.delimited.DelimitedBatchProperties" version="3.9.0">
<splitType>Record</splitType>
<batchSkipRecords>0</batchSkipRecords>
<batchMessageDelimiter></batchMessageDelimiter>
<batchMessageDelimiterIncluded>false</batchMessageDelimiterIncluded>
<batchGroupingColumn></batchGroupingColumn>
<batchScript></batchScript>
</batchProperties>
</inboundProperties>
<outboundProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirDataTypeProperties" version="3.9.0">
<serializationProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirSerializationProperties" version="3.9.0">
<serializationType>JSON</serializationType>
<fhirVersion>R4</fhirVersion>
</serializationProperties>
<deserializationProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirDeserializationProperties" version="3.9.0">
<serializationType>JSON</serializationType>
</deserializationProperties>
<batchProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirBatchProperties" version="3.9.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</outboundProperties>
</transformer>
<filter version="3.9.0">
<elements/>
</filter>
<transportName>HTTP Listener</transportName>
<mode>SOURCE</mode>
<enabled>true</enabled>
<waitForPrevious>true</waitForPrevious>
</sourceConnector>
<destinationConnectors>
<connector version="3.9.0">
<metaDataId>1</metaDataId>
<name>Destination 1</name>
<properties class="com.mirth.connect.connectors.vm.VmDispatcherProperties" version="3.9.0">
<pluginProperties/>
<destinationConnectorProperties version="3.9.0">
<queueEnabled>false</queueEnabled>
<sendFirst>false</sendFirst>
<retryIntervalMillis>10000</retryIntervalMillis>
<regenerateTemplate>false</regenerateTemplate>
<retryCount>0</retryCount>
<rotate>false</rotate>
<includeFilterTransformer>false</includeFilterTransformer>
<threadCount>1</threadCount>
<threadAssignmentVariable></threadAssignmentVariable>
<validateResponse>false</validateResponse>
<resourceIds class="linked-hash-map">
<entry>
<string>Default Resource</string>
<string>[Default Resource]</string>
</entry>
</resourceIds>
<queueBufferSize>1000</queueBufferSize>
<reattachAttachments>true</reattachAttachments>
</destinationConnectorProperties>
<channelId>none</channelId>
<channelTemplate>${message.encodedData}</channelTemplate>
<mapVariables/>
</properties>
<transformer version="3.9.0">
<elements>
<com.mirth.connect.plugins.mapper.MapperStep version="3.9.0">
<name>measureReportBundle</name>
<sequenceNumber>0</sequenceNumber>
<enabled>true</enabled>
<variable>measureReportBundle</variable>
<mapping>msg</mapping>
<defaultValue></defaultValue>
<replacements/>
<scope>CHANNEL</scope>
</com.mirth.connect.plugins.mapper.MapperStep>
</elements>
<inboundTemplate encoding="base64"></inboundTemplate>
<outboundTemplate encoding="base64"></outboundTemplate>
<inboundDataType>FHIR</inboundDataType>
<outboundDataType>FHIR</outboundDataType>
<inboundProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirDataTypeProperties" version="3.9.0">
<serializationProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirSerializationProperties" version="3.9.0">
<serializationType>JSON</serializationType>
<fhirVersion>R4</fhirVersion>
</serializationProperties>
<deserializationProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirDeserializationProperties" version="3.9.0">
<serializationType>JSON</serializationType>
</deserializationProperties>
<batchProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirBatchProperties" version="3.9.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</inboundProperties>
<outboundProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirDataTypeProperties" version="3.9.0">
<serializationProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirSerializationProperties" version="3.9.0">
<serializationType>JSON</serializationType>
<fhirVersion>R4</fhirVersion>
</serializationProperties>
<deserializationProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirDeserializationProperties" version="3.9.0">
<serializationType>JSON</serializationType>
</deserializationProperties>
<batchProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirBatchProperties" version="3.9.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</outboundProperties>
</transformer>
<responseTransformer version="3.9.0">
<elements>
<com.mirth.connect.plugins.javascriptstep.JavaScriptStep version="3.9.0">
<name>add measureReportBundle to response</name>
<sequenceNumber>0</sequenceNumber>
<enabled>true</enabled>
<script>msg = $('measureReportBundle');</script>
</com.mirth.connect.plugins.javascriptstep.JavaScriptStep>
</elements>
<inboundTemplate encoding="base64"></inboundTemplate>
<outboundTemplate encoding="base64"></outboundTemplate>
<inboundDataType>RAW</inboundDataType>
<outboundDataType>FHIR</outboundDataType>
<inboundProperties class="com.mirth.connect.plugins.datatypes.raw.RawDataTypeProperties" version="3.9.0">
<batchProperties class="com.mirth.connect.plugins.datatypes.raw.RawBatchProperties" version="3.9.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</inboundProperties>
<outboundProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirDataTypeProperties" version="3.9.0">
<serializationProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirSerializationProperties" version="3.9.0">
<serializationType>JSON</serializationType>
<fhirVersion>R4</fhirVersion>
</serializationProperties>
<deserializationProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirDeserializationProperties" version="3.9.0">
<serializationType>JSON</serializationType>
</deserializationProperties>
<batchProperties class="com.mirth.connect.plugins.datatypes.fhir.shared.FhirBatchProperties" version="3.9.0">
<splitType>JavaScript</splitType>
<batchScript></batchScript>
</batchProperties>
</outboundProperties>
</responseTransformer>
<filter version="3.9.0">
<elements/>
</filter>
<transportName>Channel Writer</transportName>
<mode>DESTINATION</mode>
<enabled>true</enabled>
<waitForPrevious>true</waitForPrevious>
</connector>
</destinationConnectors>
<preprocessingScript>// Modify the message variable below to pre process data
return message;</preprocessingScript>
<postprocessingScript>// This script executes once after a message has been processed
// Responses returned from here will be stored as "Postprocessor" in the response map
return;</postprocessingScript>
<deployScript>// This script executes once when the channel is deployed
// You only have access to the globalMap and globalChannelMap here to persist data
return;</deployScript>
<undeployScript>// This script executes once when the channel is undeployed
// You only have access to the globalMap and globalChannelMap here to persist data
return;</undeployScript>
<properties version="3.9.0">
<clearGlobalChannelMap>true</clearGlobalChannelMap>
<messageStorageMode>DEVELOPMENT</messageStorageMode>
<encryptData>false</encryptData>
<removeContentOnCompletion>false</removeContentOnCompletion>
<removeOnlyFilteredOnCompletion>false</removeOnlyFilteredOnCompletion>
<removeAttachmentsOnCompletion>false</removeAttachmentsOnCompletion>
<initialState>STARTED</initialState>
<storeAttachments>true</storeAttachments>
<metaDataColumns>
<metaDataColumn>
<name>SOURCE</name>
<type>STRING</type>
<mappingName>mirth_source</mappingName>
</metaDataColumn>
<metaDataColumn>
<name>TYPE</name>
<type>STRING</type>
<mappingName>mirth_type</mappingName>
</metaDataColumn>
</metaDataColumns>
<attachmentProperties version="3.9.0">
<type>None</type>
<properties/>
</attachmentProperties>
<resourceIds class="linked-hash-map">
<entry>
<string>Default Resource</string>
<string>[Default Resource]</string>
</entry>
</resourceIds>
</properties>
<exportData>
<metadata>
<enabled>true</enabled>
<lastModified>
<time>1592592274614</time>
<timezone>America/Los_Angeles</timezone>
</lastModified>
<pruningSettings>
<archiveEnabled>true</archiveEnabled>
</pruningSettings>
</metadata>
<codeTemplateLibraries>
<codeTemplateLibrary version="3.9.0">
<id>a084db27-49e0-4c67-893b-ffcc9f1d6e94</id>
<name>FHIR Helper Functions</name>
<revision>3</revision>
<lastModified>
<time>1592856056107</time>
<timezone>UTC</timezone>
</lastModified>
<description>Other common helper functions used by the FHIR Listener channel.</description>
<includeNewChannels>false</includeNewChannels>
<enabledChannelIds>
<string>1892f241-d643-4abb-b0af-b20b87e0cf12</string>
<string>11b8bb4e-6a05-481c-ad7e-e2026c062daa</string>
<string>b7ea555f-67e8-4380-8d67-ddbca4db628e</string>
<string>6ee5452f-792a-4f77-aada-4bca1de14b07</string>
<string>32e8a925-b0de-440d-9d5c-77265106de8f</string>
<string>c57fce23-dc30-4095-8040-72c0e83dce8d</string>
<string>fbd897e1-b661-490a-b546-275f48e43f7d</string>
<string>e99f4297-62bc-4323-a04d-752cda42e659</string>
<string>23e68077-7c1c-4638-b5b5-9d029cef6163</string>
<string>f6710348-d553-4c88-ab71-41a88e929e4d</string>
<string>50ead7ad-6d84-4217-a22b-0902c08bc091</string>
<string>cb5cbac4-c3f6-4f5f-a417-e80103fb2b62</string>
<string>157efdf9-3402-491b-92b1-5929bc4e787f</string>
<string>b8d58010-6982-47d8-9253-365ac4fd03d1</string>
<string>6540dd0b-572f-471b-bfcb-6288a38191ac</string>
<string>919a4220-394f-48ea-92f8-841afc86ce3e</string>
<string>6978b08f-7b35-419c-806c-40ab88352adc</string>
<string>96ed09ab-0af2-4414-85e0-61629d76085b</string>
<string>f2075620-e011-4280-bbd2-33986a15313a</string>
<string>a25c03d6-3b28-495b-a3ed-0015c923e19f</string>
</enabledChannelIds>
<disabledChannelIds>
<string>2f7e3c54-1320-4ed1-9d75-a9af7d7e99da</string>
<string>daeb0a8a-bce8-4114-8748-41e61d0f5da1</string>
<string>80804528-767e-4972-ac58-ab532e1986bc</string>
<string>752dbe9d-ba15-422b-8a3e-2bff57ad6a78</string>
<string>7db1559f-6ca5-464a-954c-6eb8a0e7656c</string>
<string>98d6e634-66b1-45ca-b5c6-a9d1a7b82c1a</string>
<string>f06b628e-0b68-4cb3-9eea-cb7788d0a8ef</string>
<string>938511aa-2277-493f-9014-f568bb361f64</string>
</disabledChannelIds>
<codeTemplates>
<codeTemplate version="3.9.0">
<id>d8e6f7a5-aeec-4025-a6d2-e568eb48e647</id>
<name>Convert Date</name>
<revision>1</revision>
<lastModified>
<time>1592591182168</time>
<timezone>UTC</timezone>
</lastModified>
<contextSet>
<delegate>
<contextType>DESTINATION_FILTER_TRANSFORMER</contextType>
<contextType>DESTINATION_RESPONSE_TRANSFORMER</contextType>
<contextType>DESTINATION_DISPATCHER</contextType>
<contextType>SOURCE_RECEIVER</contextType>
<contextType>SOURCE_FILTER_TRANSFORMER</contextType>
</delegate>
</contextSet>
<properties class="com.mirth.connect.model.codetemplates.BasicCodeTemplateProperties">
<type>FUNCTION</type>
<code>/**
Supports parsing date strings in a variety of formats and outputting the date in a specific format.
*/
var patterns = [
"yyyy-MM-dd HH:mm:ss.SSSSSSS ZZ",
"yyyy-MM-dd'T'HH:mm:ss.SSSZ",
"yyyy-MM-dd'T'HH:mm:ssZ",
"yyyy-MM-dd'T'HH:mm:ss",
"yyyy-MM-dd'T'HH:mm",
'yyyy-MM-dd',
'yyyy-MM-dd HH:mm:ss:SSS',
'yyyy-MM-dd HH:mm:ss.SSS',
'yyyy-MM-dd HH:mm:ss',
'yyyy-MM-dd HH:mm',
'EEE MMM dd HH:mm:ss:SSS zzz yyyy',
'EEE MMM dd HH:mm:ss.SSS zzz yyyy',
'EEE MMM dd HH:mm:ss zzz yyyy',
'EEE MMM dd zzz yyyy',
'dd-MMM-yyyy HH:mm:ss:SSS',
'dd-MMM-yyyy HH:mm:ss.SSS',
'dd-MMM-yyyy HH:mm:ss',
'yyyy MM dd',
'yyyy.MM.dd',
'MM-dd-yyyy',
'MM dd yyyy',
'MM.dd.yyyy',
'HH:mm:ss:SSS',
'HH:mm:ss.SSS',
'HH:mm:ss',
'yyyyMMddHHmmssSSS',
'yyyyMMddHHmmss',
'yyyyMMddHHmm',
'hh:mm aa',
'MM/dd/yy',
'MM/dd/yyyy'];
var formatters = [];
for each (pattern in patterns) {
formatters.push(org.joda.time.format.DateTimeFormat.forPattern(pattern).withPivotYear(2000));
}
function getMillis(date) {
var instant = 0;
if (typeof date == 'number' || date instanceof java.lang.Number)
instant = new Number(date);
else if (date instanceof Date || date instanceof java.util.Date)
instant = date.getTime();
else if (date instanceof org.joda.time.ReadableInstant)
instant = date.getMillis();
else {
for each (formatter in formatters) {
try {
instant = formatter.parseMillis(new String(date));
break;
} catch(e) {}
}
}
return instant;
}
function getDate(date) {
return new java.util.Date(getMillis(date));
}
function convertDate(date, outpattern) {
return org.joda.time.format.DateTimeFormat.forPattern(outpattern).print(getMillis(date));
}</code>
</properties>
</codeTemplate>
<codeTemplate version="3.9.0">
<id>0e158aa1-77ee-465c-bb7a-13f4c8ecda13</id>
<name>Create FHIR OperationOutcome</name>
<revision>1</revision>
<lastModified>
<time>1592591182327</time>
<timezone>UTC</timezone>
</lastModified>
<contextSet>
<delegate>
<contextType>DESTINATION_FILTER_TRANSFORMER</contextType>
<contextType>DESTINATION_RESPONSE_TRANSFORMER</contextType>
<contextType>CHANNEL_ATTACHMENT</contextType>
<contextType>DESTINATION_DISPATCHER</contextType>
<contextType>SOURCE_RECEIVER</contextType>
<contextType>CHANNEL_POSTPROCESSOR</contextType>
<contextType>SOURCE_FILTER_TRANSFORMER</contextType>
</delegate>
</contextSet>
<properties class="com.mirth.connect.model.codetemplates.BasicCodeTemplateProperties">
<type>FUNCTION</type>
<code>/**
Creates a FHIR OperationOutcome resource and adds it to the response map with the key "response".
@param {String} severity - Indicates whether the issue indicates a variation from successful
processing. Values: fatal | error | warning | information
@param {String} code - Describes the type of the issue. The system that creates an
OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may
additional provide its own code for the error in the details element. Values: invalid | security |
processing | transient | informational
@param {String} details - Additional details about the error. This may be a text description of
the error, or a system code that identifies the error.
@param {String} fhirVersion - The FHIR version of the OperationOutcome resource. Values: DSTU2 | DSTU2_1 |
DSTU_HL7ORG | STU3 | R4 | R5
@param {int} httpStatusCode - The HTTP status code to send back with the response. Defaults to 400
if not specified.
@param {Error} e - If included, this will be used to build up the response status message and
error.
@param {Boolean} isFormatXML - If true, the resource will be formatted in XML. Otherwise, it will
be formatted in JSON. If not specified, it will attempt to find the _format parameter in the source
map, or return JSON.
@return {Response} The created Response object.
*/
function createOperationOutcome(severity, code, details, fhirVersion, httpStatusCode, e, isFormatXML) {
if (!httpStatusCode) {
httpStatusCode = 400;
}
if (!isFormatXML && $s('parameters') && $s('parameters').contains('_format')) {
isFormatXML = !FhirUtil.isJSON($s('parameters').getParameter('_format'));
}
var outcome = FhirUtil.createOperationOutcome(severity, code, details, fhirVersion);
var message = isFormatXML ? FhirUtil.toXML(outcome, fhirVersion) : FhirUtil.toJSON(outcome, fhirVersion);
responseMap.put('response', FhirResponseFactory.getResponse(message, httpStatusCode, isFormatXML ? FhirUtil.getMIMETypeXML() : FhirUtil.getMIMETypeJSON()));
var response = new Response(message);
response.setStatusMessage(severity.toUpperCase() + ' OperationOutcome created with status ' + httpStatusCode + '.');
if (httpStatusCode >= 400) {
response.setStatus(Status.ERROR);
if (e) {
var customMessage = 'Channel ' + channelName + ': ';
if (e.rhinoException) {
customMessage += 'Error on line ' + e.rhinoException.lineNumber() + ': ';
}
customMessage += e.toString();
var errorContent = com.mirth.connect.util.ErrorMessageBuilder.buildErrorMessage('FHIR Listener', customMessage, e.javaException || null);
if (e.javaException) {
logger.error(errorContent, e.javaException);
} else {
logger.error(errorContent);
}
response.setError(errorContent);
}
}
return response;
}</code>
</properties>
</codeTemplate>
<codeTemplate version="3.9.0">
<id>a9691b6e-b455-4789-b4d7-89bcc095a163</id>
<name>Get Prefer Header Value</name>
<revision>1</revision>
<lastModified>
<time>1592591182213</time>
<timezone>UTC</timezone>
</lastModified>
<contextSet>
<delegate>
<contextType>DESTINATION_FILTER_TRANSFORMER</contextType>
<contextType>DESTINATION_RESPONSE_TRANSFORMER</contextType>
<contextType>CHANNEL_ATTACHMENT</contextType>
<contextType>DESTINATION_DISPATCHER</contextType>
<contextType>SOURCE_RECEIVER</contextType>
<contextType>CHANNEL_POSTPROCESSOR</contextType>
<contextType>SOURCE_FILTER_TRANSFORMER</contextType>
</delegate>
</contextSet>
<properties class="com.mirth.connect.model.codetemplates.BasicCodeTemplateProperties">
<type>FUNCTION</type>
<code>/**
Returns the "return" element of the Prefer HTTP header if specified.
@return {String} The "return" element of the Prefer header, or undefined if not present
*/
function getPreferValue() {
var preferReturn;
var preferHeader = $('headers').getHeader('Prefer');
if (preferHeader) {
for each (element in new org.apache.http.message.BasicHeader('Prefer', preferHeader).getElements()) {
if (element.getName() == 'return') {
preferReturn = element.getValue();
break;
}
}
}
return preferReturn;
}</code>
</properties>
</codeTemplate>
<codeTemplate version="3.9.0">
<id>18c799ae-3553-40b0-b8cc-8898fbad5f7d</id>
<name>Import Common Packages</name>
<revision>1</revision>
<lastModified>
<time>1592591182039</time>
<timezone>UTC</timezone>
</lastModified>
<contextSet>
<delegate>
<contextType>DESTINATION_FILTER_TRANSFORMER</contextType>
<contextType>DESTINATION_RESPONSE_TRANSFORMER</contextType>
<contextType>CHANNEL_ATTACHMENT</contextType>
<contextType>DESTINATION_DISPATCHER</contextType>
<contextType>SOURCE_RECEIVER</contextType>
<contextType>CHANNEL_POSTPROCESSOR</contextType>
<contextType>SOURCE_FILTER_TRANSFORMER</contextType>
</delegate>
</contextSet>
<properties class="com.mirth.connect.model.codetemplates.BasicCodeTemplateProperties">
<type>COMPILED_CODE</type>
<code>/**
Imports HAPI FHIR packages commonly used in the FHIR Listener channel.
*/
importPackage(Packages.ca.uhn.fhir.model.api);
importPackage(Packages.ca.uhn.fhir.model.base.resource);
importPackage(Packages.ca.uhn.fhir.model.primitive);
importPackage(Packages.org.hl7.fhir.r4.model);
importPackage(org.apache.commons.lang3);
importPackage(org.apache.commons.lang3.math);</code>
</properties>
</codeTemplate>
<codeTemplate version="3.9.0">
<id>ece0b77f-a9bc-43f1-ae57-96bb3a1b4143</id>
<name>Update Resource Meta</name>
<revision>1</revision>
<lastModified>
<time>1592591182144</time>
<timezone>UTC</timezone>
</lastModified>
<contextSet>
<delegate>
<contextType>DESTINATION_FILTER_TRANSFORMER</contextType>
<contextType>DESTINATION_RESPONSE_TRANSFORMER</contextType>
<contextType>DESTINATION_DISPATCHER</contextType>
<contextType>SOURCE_RECEIVER</contextType>
<contextType>SOURCE_FILTER_TRANSFORMER</contextType>
</delegate>
</contextSet>
<properties class="com.mirth.connect.model.codetemplates.BasicCodeTemplateProperties">
<type>FUNCTION</type>
<code>/**
Sets the resource ID, version ID, and last updated date/time.
@param {IBaseResource} resource - The FHIR resource object.
@param {String} id - The logical ID of the resource.
@param {Number} versionId - The version ID of the resource.
@return {Date} The last updated date/time.
*/
function updateResourceMeta(resource, id, versionId) {
resource.setId(id);
resource.getMeta().setVersionId(new String(versionId));
var lastUpdated = new java.util.Date();
resource.getMeta().getLastUpdatedElement().setTimeZone(java.util.TimeZone.getDefault());
resource.getMeta().setLastUpdated(lastUpdated);
return lastUpdated;
}</code>
</properties>
</codeTemplate>
</codeTemplates>
</codeTemplateLibrary>
<codeTemplateLibrary version="3.9.0">
<id>4b08338c-c4fd-4ff4-adcd-326fb0892fb3</id>
<name>FHIR SANER Helper Functions</name>
<revision>5</revision>
<lastModified>
<time>1592856056117</time>
<timezone>UTC</timezone>
</lastModified>
<description>SANER specific Helper functions</description>
<includeNewChannels>false</includeNewChannels>
<enabledChannelIds>
<string>50ead7ad-6d84-4217-a22b-0902c08bc091</string>
<string>cb5cbac4-c3f6-4f5f-a417-e80103fb2b62</string>
<string>11b8bb4e-6a05-481c-ad7e-e2026c062daa</string>
<string>b8d58010-6982-47d8-9253-365ac4fd03d1</string>
<string>b7ea555f-67e8-4380-8d67-ddbca4db628e</string>
<string>6978b08f-7b35-419c-806c-40ab88352adc</string>
<string>c57fce23-dc30-4095-8040-72c0e83dce8d</string>
<string>fbd897e1-b661-490a-b546-275f48e43f7d</string>
<string>e99f4297-62bc-4323-a04d-752cda42e659</string>
<string>f6710348-d553-4c88-ab71-41a88e929e4d</string>
</enabledChannelIds>
<disabledChannelIds>
<string>1892f241-d643-4abb-b0af-b20b87e0cf12</string>
<string>6ee5452f-792a-4f77-aada-4bca1de14b07</string>
<string>32e8a925-b0de-440d-9d5c-77265106de8f</string>
<string>98d6e634-66b1-45ca-b5c6-a9d1a7b82c1a</string>
<string>23e68077-7c1c-4638-b5b5-9d029cef6163</string>
<string>938511aa-2277-493f-9014-f568bb361f64</string>
<string>2f7e3c54-1320-4ed1-9d75-a9af7d7e99da</string>
<string>daeb0a8a-bce8-4114-8748-41e61d0f5da1</string>
<string>157efdf9-3402-491b-92b1-5929bc4e787f</string>
<string>80804528-767e-4972-ac58-ab532e1986bc</string>
<string>6540dd0b-572f-471b-bfcb-6288a38191ac</string>
<string>752dbe9d-ba15-422b-8a3e-2bff57ad6a78</string>
<string>919a4220-394f-48ea-92f8-841afc86ce3e</string>
<string>7db1559f-6ca5-464a-954c-6eb8a0e7656c</string>
<string>96ed09ab-0af2-4414-85e0-61629d76085b</string>
<string>f2075620-e011-4280-bbd2-33986a15313a</string>
<string>f06b628e-0b68-4cb3-9eea-cb7788d0a8ef</string>
<string>a25c03d6-3b28-495b-a3ed-0015c923e19f</string>
</disabledChannelIds>
<codeTemplates>
<codeTemplate version="3.9.0">
<id>132d0f83-1744-4f7c-b0dd-1802dce979b7</id>
<name>Create Bundle from list of Bundle_Entry resources</name>
<revision>1</revision>
<lastModified>
<time>1592591218684</time>
<timezone>UTC</timezone>
</lastModified>
<contextSet>
<delegate>
<contextType>DESTINATION_FILTER_TRANSFORMER</contextType>
<contextType>DESTINATION_RESPONSE_TRANSFORMER</contextType>
<contextType>DESTINATION_DISPATCHER</contextType>
<contextType>SOURCE_RECEIVER</contextType>
<contextType>SOURCE_FILTER_TRANSFORMER</contextType>
</delegate>
</contextSet>
<properties class="com.mirth.connect.plugins.fhir.shared.FhirModelBuilderCodeTemplateProperties" version="3.9.0">
<type>FUNCTION</type>
<functionSignature>createBundle(type, bundleEntries)</functionSignature>
<jsDoc>/**
Returns a "collection" Bundle that includes a list of Bundle_Entry resources
@param {String} type - The type of the bundle (document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection)
@param {Object} bundleEntries - The bundle entries included in the Bundle
@return {Object} The JavaScript Object representation of the Bundle FHIR resource.
*/</jsDoc>
<resultReturnValue>true</resultReturnValue>
<resultMapType>CHANNEL</resultMapType>
<resultMapVariable></resultMapVariable>
<definition>Bundle</definition>
<model class="com.mirth.connect.jsonbuilder.shared.models.ObjectModel">
<usingBuilder>true</usingBuilder>
<properties class="linked-hash-map">
<entry>
<string>resourceType</string>
<com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
<enabled>true</enabled>
<properties class="com.mirth.connect.jsonbuilder.shared.models.StringModel">
<stringValue>Bundle</stringValue>
</properties>
</com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
</entry>
<entry>
<string>type</string>
<com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
<enabled>true</enabled>
<properties class="com.mirth.connect.jsonbuilder.shared.models.StringModel">
<stringValue>type</stringValue>
<scriptExpression>true</scriptExpression>
</properties>
</com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
</entry>
<entry>
<string>entry</string>
<com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
<enabled>true</enabled>
<properties class="com.mirth.connect.jsonbuilder.shared.models.ArrayModel">
<stringValue>bundleEntries</stringValue>
</properties>
</com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
</entry>
</properties>
</model>
<fhirVersion>R4</fhirVersion>
</properties>
</codeTemplate>
<codeTemplate version="3.9.0">
<id>718fa75e-393c-4af4-a227-1051d58608c2</id>
<name>Create Bundle_Entry with FHIR Resource</name>
<revision>1</revision>
<lastModified>
<time>1592591218940</time>
<timezone>UTC</timezone>
</lastModified>
<contextSet>
<delegate>
<contextType>DESTINATION_FILTER_TRANSFORMER</contextType>
<contextType>DESTINATION_RESPONSE_TRANSFORMER</contextType>
<contextType>DESTINATION_DISPATCHER</contextType>
<contextType>SOURCE_RECEIVER</contextType>
<contextType>SOURCE_FILTER_TRANSFORMER</contextType>
</delegate>
</contextSet>
<properties class="com.mirth.connect.plugins.fhir.shared.FhirModelBuilderCodeTemplateProperties" version="3.9.0">
<type>FUNCTION</type>
<functionSignature>createBundle_Entry(fhirResource)</functionSignature>
<jsDoc>/**
Returns a BundleEntry resource
@param {Object} fhirResource - The resource included in the bundle entry
@return {Object} The JavaScript Object representation of the Bundle_Entry FHIR resource.
*/</jsDoc>
<resultReturnValue>true</resultReturnValue>
<resultMapType>CHANNEL</resultMapType>
<resultMapVariable></resultMapVariable>
<definition>Bundle_Entry</definition>
<model class="com.mirth.connect.jsonbuilder.shared.models.ObjectModel">
<usingBuilder>true</usingBuilder>
<properties class="linked-hash-map">
<entry>
<string>resource</string>
<com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
<enabled>true</enabled>
<properties class="com.mirth.connect.jsonbuilder.shared.models.OneOfModel">
<stringValue>fhirResource</stringValue>
</properties>
</com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
</entry>
</properties>
</model>
<fhirVersion>R4</fhirVersion>
</properties>
</codeTemplate>
<codeTemplate version="3.9.0">
<id>3c0c304b-ca04-4437-a69a-6b489d8ba399</id>
<name>Create MeasureReport from CDC CSV row</name>
<revision>1</revision>
<lastModified>
<time>1592609903334</time>
<timezone>UTC</timezone>
</lastModified>
<contextSet>
<delegate>
<contextType>DESTINATION_FILTER_TRANSFORMER</contextType>
<contextType>DESTINATION_RESPONSE_TRANSFORMER</contextType>
<contextType>DESTINATION_DISPATCHER</contextType>
<contextType>SOURCE_RECEIVER</contextType>
<contextType>SOURCE_FILTER_TRANSFORMER</contextType>
</delegate>
</contextSet>
<properties class="com.mirth.connect.plugins.fhir.shared.FhirModelBuilderCodeTemplateProperties" version="3.9.0">
<type>FUNCTION</type>
<functionSignature>createCDCMeasureReport(csvRow, subject, reporter, narrativeText)</functionSignature>
<jsDoc>/**
Create a MeasureReport resource from a CDC CSV row of data. Optionally, add narrative text.
@param {Object} csvRow - A row of data from a CDC CSV report
@param {String} narrativeText - The optional text to use as the Narrative text for the MeasureReport
@return {Object} The JavaScript Object representation of the FHIR MeasureReport resource.
*/</jsDoc>
<resultReturnValue>true</resultReturnValue>
<resultMapType>CHANNEL</resultMapType>
<resultMapVariable></resultMapVariable>
<definition>MeasureReport</definition>
<model class="com.mirth.connect.jsonbuilder.shared.models.ObjectModel">
<usingBuilder>true</usingBuilder>
<properties class="linked-hash-map">
<entry>
<string>resourceType</string>
<com.mirth.connect.jsonbuilder.shared.models.ObjectProperty>
<enabled>true</enabled>
<properties class="com.mirth.connect.jsonbuilder.shared.models.StringModel">
<stringValue>MeasureReport</stringValue>
</properties>