30. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 10/4/2017 8:04:33 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

30.1 Files compared

# Location File Last Modified
1 rdk.zip\rdk\product\production\rdk\src\fhir\order\diagnostic-order diagnostic-order-resource.js Mon Aug 21 12:51:00 2017 UTC
2 rdk.zip\rdk\product\production\rdk\src\fhir\order\diagnostic-order diagnostic-order-resource.js Tue Oct 3 18:03:57 2017 UTC

30.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 8 652
Changed 7 14
Inserted 0 0
Removed 0 0

30.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

30.4 Active regular expressions

No regular expressions were active.

30.5 Comparison detail

  1   'use stric t';
  2   var rdk =  require('. ./../../co re/rdk');
  3   var _ = re quire('lod ash');
  4   var nullch ecker = rd k.utils.nu llchecker;
  5   var fhirTo JDSSearch  = require( '../../com mon/utils/ fhir-to-jd s-search') ;
  6   var diagno sticOrder  = require( './diagnos tic-order' );
  7   var confor manceUtils  = require ('../../co nformance/ conformanc e-utils');
  8   var confor mance = re quire('../ ../conform ance/confo rmance-res ource');
  9  
  10   var fhirTo JDSAttrMap  = [{
  11       fhirNa me: 'subje ct.identif ier',
  12       vprNam e: 'pid',
  13       dataTy pe: 'strin g',
  14       defini tion: 'htt p://hl7.or g/FHIR/201 5May/datat ypes.html# string',
  15       descri ption: 'Pa tient inde ntifier -  note that  this patie nt identif ier will o verrule an y patient  identifier  that is i n the URI  of this en dpoint.',
  16       search able: true
  17   },{
  18       fhirNa me: 'pid',
  19       vprNam e: 'pid',
  20       dataTy pe: 'strin g',
  21       defini tion: 'htt p://hl7.or g/FHIR/201 5May/datat ypes.html# string',
  22       descri ption: 'Pa tient inde ntifier -  note that  this patie nt identif ier will o verrule an y patient  identifier  that has  been speci fied in th e URI of t his endpoi nt as well  as the su bject.iden tifier on  the query  string.',
  23       search able: true
  24   },{
  25       fhirNa me: 'event -date',
  26       vprNam e: 'entere d',
  27       dataTy pe: 'date' ,
  28       defini tion: 'htt p://hl7.or g/fhir/201 5MAY/datat ypes.html# date',
  29       descri ption: 'Th e date at  which the  event happ ened.',
  30       search able: true
  31   },{
  32       fhirNa me: 'code' ,
  33       vprNam e: 'item[] .code.codi ng[].code' ,
  34       dataTy pe: 'strin g',
  35       defini tion: 'htt p://hl7.or g/FHIR/201 5May/datat ypes.html# string',
  36       descri ption: 'Co de to indi cate the i tem (test  or panel)  being orde red.',
  37       search able: true
  38   }];
  39   conformanc eUtils.add CountAttri bute(fhirT oJDSAttrMa p); //addi ng the _co unt attrib ute that i s common t o (almost)  all endpo ints.
  40  
  41   // Issue c all to Con formance r egistratio n
  42   conformanc e.register (conforman ceUtils.do mains.DIAG NOSTIC_ORD ER, create Diagnostic OrderConfo rmanceData ());
  43  
  44   function c reateDiagn osticOrder Conformanc eData() {
  45      var res ourceType  = conforma nceUtils.d omains.DIA GNOSTIC_OR DER;
  46      var pro fileRefere nce = 'htt p://hl7.or g/fhir/201 5MAY/diagn osticorder .html';
  47      var int eractions  = [ 'read' , 'search- type' ];
  48  
  49      return  conformanc eUtils.cre ateConform anceData(r esourceTyp e, profile Reference,
  50               interacti ons, fhirT oJDSAttrMa p);
  51   }
  52  
  53   function g etResource Config() {
  54       return  [{
  55           na me: 'fhir- order-diag nostic-ord er',
  56           pa th: '',
  57           ge t: getDiag nosticOrde r,
  58           su bsystems:  ['patientr ecord', 'j ds', 'solr ', 'jdsSyn c', 'autho rization'] ,
  59           in terceptors : { fhirPi d: true, v alidatePid : false },
  60           re quiredPerm issions: [ 'read-fhir '],
  61           is PatientCen tric: true ,
  62           pe rmitRespon seFormat:  true
  63       },{
  64           na me: 'fhir- order-diag nostic-ord er-search' ,
  65           pa th: '_sear ch',
  66           po st: getDia gnosticOrd er,
  67           su bsystems:  ['patientr ecord', 'j ds', 'solr ', 'jdsSyn c', 'autho rization'] ,
  68           in terceptors : { fhirPi d: true, v alidatePid : false },
  69           re quiredPerm issions: [ 'read-fhir '],
  70           is PatientCen tric: true ,
  71           pe rmitRespon seFormat:  true
  72       }];
  73   }
  74  
  75   /**
  76    * @api {g et} /fhir/ patient/{i d}/diagnos ticorder G et Diagnos tic Order
  77    * @apiNam e getDiagn osticOrder
  78    * @apiGro up Diagnos tic Order
  79    * @apiPar am {String } id The p atient id
  80    * @apiPar am {Number } [_count]  The numbe r of resul ts to show .
  81    *
  82    * @apiDes cription C onverts a  vpr call f or radiolo gy and lab oratory or ders into  a FHIR \'D iagnosticO rder\' res ource.
  83    *
  84    * @apiExa mple {js}  Request Ex amples:
  85    *      //  Limiting  results co unt
  86    *        http:// IP             /resource/ fhir/patie nt/ R E D A CTED ;253/diagn osticorder ?_count=1
  87    *
  88    * @apiSuc cess {json } data JSO N object c onforming  to the <a  href="http ://www.hl7 .org/FHIR/ 2015May/di agnosticor der.html"> Diagnostic  Order FHI R DTSU2 sp ecificatio n</a>.
  89    * @apiSuc cessExampl e Success- Response:
  90    * HTTP/1. 1 200 OK
  91    * {
  92    *     "re sourceType ": "Bundle ",
  93    *     "ty pe": "coll ection",
  94    *     "id ": "bd2860 db-0439-4c f3-8e50-02 d6a0776dba ",
  95    *     "li nk": [
  96    *          {
  97    *              "rela tion": "se lf",
  98    *                "url": "ht tp://local host:8888/ resource/f hir/patien t/ R E D A CTED ;253/diagn osticorder ?_count=1"
  99    *          }
  100    *     ],
  101    *     "to tal": 489,
  102    *     "en try": [
  103    *          {
  104    *              "reso urce": {
  105    *                  " resourceTy pe": "Diag nosticOrde r",
  106    *                  " id": "46f2 0ac5-9902- 4207-e1c4- ab9fb81357 96",
  107    *                  " subject":  {
  108    *                        "reference ": "Patien t/ R E D A CTED ;253"
  109    *                  } ,
  110    *                  " item": [
  111    *                       {
  112    *                           "co de": {
  113    *                                "coding":  [
  114    *                                    {
  115    *                                        " system": " urn:oid:2. 16.840.1.1 13883.6.23 3",
  116    *                                        " code": "ur n:va:oi:13 39",
  117    *                                        " display":  "24 HR URI NE CALCIUM ",
  118    *                                        " extension" : [
  119    *                                             {
  120    *                                                 "ur l": "http: //vistacor e.us/fhir/ extensions /diagnosti corder#oiP ackageRef" ,
  121    *                                                 "va lueString" : "5083;99 LRT"
  122    *                                             }
  123    *                                        ]
  124    *                                    }
  125    *                                ]
  126    *                           }
  127    *                       }
  128    *                  ] ,
  129    *                  " text": {
  130    *                       "status ": "genera ted",
  131    *                       "div":  "<div>24 H R URINE CA LCIUM</div >"
  132    *                  } ,
  133    *                  " contained" : [
  134    *                       {
  135    *                           "re sourceType ": "Practi tioner",
  136    *                           "id ": "955748 65-0d28-46 9c-a90b-bb 70ef1a7c86 ",
  137    *                           "te xt": {
  138    *                                "status":  "generate d",
  139    *                                "div": "< div>Progra mmer,One</ div>"
  140    *                           },
  141    *                           "na me": {
  142    *                                "family":  [
  143    *                                    "PROG RAMMER"
  144    *                                ],
  145    *                                "given":  [
  146    *                                    "ONE"
  147    *                                ]
  148    *                           },
  149    *                           "id entifier":  [
  150    *                                {
  151    *                                    "syst em": "http ://vistaco re.us/fhir /id/uid",
  152    *                                      "value": " urn:va:use r: R E D A CTED :1"
  153    *                                }
  154    *                           ]
  155    *                       },
  156    *                       {
  157    *                           "re sourceType ": "Practi tioner",
  158    *                           "id ": "556db0 e1-73bb-41 a8-ea6d-2a 9b64bbd1bb ",
  159    *                           "te xt": {
  160    *                                "status":  "generate d",
  161    *                                "div": "< div>PROGRA MMER,ONE</ div>"
  162    *                           },
  163    *                           "na me": {
  164    *                                "family":  [
  165    *                                    "PROG RAMMER"
  166    *                                ],
  167    *                                "given":  [
  168    *                                    "ONE"
  169    *                                ]
  170    *                           },
  171    *                           "id entifier":  [
  172    *                                {
  173    *                                    "syst em": "http ://vistaco re.us/fhir /id/uid",
  174    *                                      "value": " urn:va:use r: R E D A CTED :1"
  175    *                                }
  176    *                           ],
  177    *                           "ex tension":  [
  178    *                                {
  179    *                                    "url" : "http:// vistacore. us/fhir/ex tensions/d iagnostico rder#role" ,
  180    *                                    "valu eString":  "S"
  181    *                                },
  182    *                                {
  183    *                                    "url" : "http:// vistacore. us/fhir/ex tensions/d iagnostico rder#signe dDateTime" ,
  184    *                                    "valu eString":  2014081118 39
  185    *                                }
  186    *                           ]
  187    *                       },
  188    *                       {
  189    *                           "re sourceType ": "Organi zation",
  190    *                           "id ": "81808f 2a-11ae-48 68-bc0d-e9 b21bf96c57 ",
  191    *                           "te xt": {
  192    *                                "status":  "generate d",
  193    *                                "div": "< div>ABILEN E (CAA)</d iv>"
  194    *                           },
  195    *                           "id entifier":  [
  196    *                                {
  197    *                                    "syst em": "http ://vistaco re.us/fhir /id/uid",
  198    *                                    "valu e": "998"
  199    *                                }
  200    *                           ]
  201    *                       },
  202    *                       {
  203    *                           "re sourceType ": "Locati on",
  204    *                           "id ": "7a65dc 6a-3583-4e b1-ca38-06 99e1f8f6cb ",
  205    *                           "te xt": {
  206    *                                "status":  "generate d",
  207    *                                "div": "< div>PRIMAR Y CARE</di v>"
  208    *                           },
  209    *                           "id entifier":  [
  210    *                                {
  211    *                                    "syst em": "http ://vistaco re.us/fhir /id/uid",
  212    *                                      "value": " urn:va:loc ation: R E D A CTED :32"
  213    *                                }
  214    *                           ]
  215    *                       }
  216    *                  ] ,
  217    *                  " orderer":  {
  218    *                       "refere nce": "#95 574865-0d2 8-469c-a90 b-bb70ef1a 7c86"
  219    *                  } ,
  220    *                  " identifier ": [
  221    *                       {
  222    *                           "sy stem": "ur n:oid:2.16 .840.1.113 883.6.233" ,
  223    *                             "value": " urn:va:ord er: R E D A CTED :253:38017 "
  224    *                       }
  225    *                  ] ,
  226    *                  " event": [
  227    *                       {
  228    *                           "de scription" : "24 HR U RINE CALCI UM Contain er C 24 HR  URINE SP  LB #18362\ \\r\\\n",
  229    *                           "da teTime": " 2014-08-11 T18:39:00+ 08:00"
  230    *                       }
  231    *                  ] ,
  232    *                  " extension" : [
  233    *                       {
  234    *                           "ur l": "http: //vistacor e.us/fhir/ extensions /diagnosti corder#kin d",
  235    *                           "va lueString" : "Laborat ory"
  236    *                       },
  237    *                       {
  238    *                           "ur l": "http: //vistacor e.us/fhir/ extensions /diagnosti corder#las tUpdateTim e",
  239    *                           "va lueString" : "2014081 1183900"
  240    *                       },
  241    *                       {
  242    *                           "ur l": "http: //vistacor e.us/fhir/ extensions /diagnosti corder#loc alId",
  243    *                           "va lueString" : "38017"
  244    *                       },
  245    *                       {
  246    *                           "ur l": "http: //vistacor e.us/fhir/ extensions /diagnosti corder#ser vice",
  247    *                           "va lueString" : "LR"
  248    *                       },
  249    *                       {
  250    *                           "ur l": "http: //vistacor e.us/fhir/ extensions /diagnosti corder#sta mpTime",
  251    *                           "va lueString" : "2014081 1183900"
  252    *                       },
  253    *                       {
  254    *                           "ur l": "http: //vistacor e.us/fhir/ extensions /diagnosti corder#sta tusCode",
  255    *                           "va lueString" : "urn:va: order-stat us:pend"
  256    *                       },
  257    *                       {
  258    *                           "ur l": "http: //vistacor e.us/fhir/ extensions /diagnosti corder#sta tusVuid",
  259    *                           "va lueString" : "urn:va: vuid:45011 14"
  260    *                       },
  261    *                       {
  262    *                           "ur l": "http: //vistacor e.us/fhir/ extensions /diagnosti corder#dis playGroup" ,
  263    *                           "va lueString" : "CH"
  264    *                       },
  265    *                       {
  266    *                           "ur l": "http: //vistacor e.us/fhir/ extensions /diagnosti corder#sta rt",
  267    *                           "va lueString" : "2014081 1"
  268    *                       },
  269    *                       {
  270    *                           "ur l": "http: //vistacor e.us/fhir/ extensions /diagnosti corder#nam e",
  271    *                           "va lueString" : "24 HR U RINE CALCI UM"
  272    *                       }
  273    *                  ]
  274    *              }
  275    *          }
  276    *     ]
  277    * }
  278    *
  279    * @apiErr or (Error  400) Inval id paramet er values.
  280    * @apiErr orExample  Error-Resp onse:
  281    * HTTP/1. 1 400 Bad  Request
  282    * {
  283    *      In valid para meter valu es.
  284    * }
  285    */
  286   function g etDiagnost icOrder(re q, res) {
  287       var pi d = req.qu ery.pid;
  288       var pa rams = req .query;
  289  
  290       if (nu llchecker. isNullish( pid)) {
  291           re turn res.s tatus(rdk. httpstatus .bad_forma t).send('M issing req uired para meter: pid ');
  292       }
  293  
  294       valida teParams(p arams, /*o nSuccess*/  function( ) {
  295           di agnosticOr der.getDat a(req.app. config, re q.logger,  pid, param s, functio n(err, inp utJSON) {
  296                if (null checker.is NotNullish (err)) {
  297                    res. status(err .code || 5 00).send(e rr.message );
  298                } else {
  299                    var  fhirBundle  = diagnos ticOrder.c onvertToFh ir(inputJS ON, req);
  300                    limi tFHIRResul tByCount(f hirBundle,  params._c ount);
  301                    res. status(rdk .httpstatu s.ok).send (fhirBundl e);
  302                }
  303           }) ;
  304       }, /*o nError*/ f unction(er rors) {
  305           re turn res.s tatus(rdk. httpstatus .bad_reque st).send(' Invalid pa rameters:'  + fhirToJ DSSearch.v alidationE rrorsToStr ing(errors ));
  306       });
  307   }
  308  
  309   function v alidatePar ams(params , onSucces s, onError ) {
  310       // che ck common  parameters
  311       fhirTo JDSSearch. validateCo mmonParams (params, f unction()  {
  312           //  validate  date
  313           fh irToJDSSea rch.valida teDatePara ms(params,  ['event-d ate'], fun ction() {
  314                if (fhir ToJDSSearc h.isSortCr iteriaVali d(params,  diagnostic Order.fhir ToJDSMap))  {
  315                    onSu ccess();
  316                } else {
  317                    onEr ror(['Unsu pported _s ort criter ia. Suppor ted attrib utes are:  ' + _.keys (diagnosti cOrder.fhi rToJDSMap) ]);
  318                }
  319           },  onError);
  320           //  FUTURE-TO DO: add va lidation f or code pa ram
  321       }, onE rror);
  322   }
  323  
  324   function l imitFHIRRe sultByCoun t(fhirBund le, countS tr) {
  325       if (nu llchecker. isNotNulli sh(countSt r)) {
  326           va r count =  parseInt(c ountStr);
  327           fh irBundle.e ntry = _.t ake(fhirBu ndle.entry , count);
  328       }
  329   }
  330  
  331   module.exp orts.getRe sourceConf ig = getRe sourceConf ig;
  332   module.exp orts.getDi agnosticOr der = getD iagnosticO rder;
  333   module.exp orts.creat eDiagnosti cOrderConf ormanceDat a = create Diagnostic OrderConfo rmanceData ;