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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | rdk.zip\rdk\product\production\rdk\src\fhir\conformance | conformance-resource.js | Mon Aug 21 12:51:00 2017 UTC |
| 2 | rdk.zip\rdk\product\production\rdk\src\fhir\conformance | conformance-resource.js | Tue Oct 3 17:15:10 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 252 |
| Changed | 2 | 4 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| 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 |
No regular expressions were active.
| 1 | 'use stric t'; | |
| 2 | var rdk = require('. ./../core/ rdk'); | |
| 3 | var _ = re quire('lod ash'); | |
| 4 | var nullch ecker = rd k.utils.nu llchecker; | |
| 5 | var resour ceArray = []; | |
| 6 | var fhirRe source = r equire('.. /common/en tities/fhi r-resource '); | |
| 7 | var confor manceUtils = require ('../confo rmance/con formance-u tils'); | |
| 8 | ||
| 9 | // as an a rray of PA RAMS and i ts ATTRIBU TES | |
| 10 | var fhirTo JDSAttrMap = [ { | |
| 11 | fhirNa me : 'reso urce', | |
| 12 | vprNam e : '', | |
| 13 | dataTy pe : 'stri ng', | |
| 14 | defini tion : 'ht tp://hl7.o rg/FHIR/20 15May/data types.html #string', | |
| 15 | descri ption : 'O ne or more of the re source typ es defined as part o f FHIR', | |
| 16 | search able : tru e | |
| 17 | }]; | |
| 18 | ||
| 19 | function g etResource Config() { | |
| 20 | return [{ | |
| 21 | na me : 'fhir -conforman ce-metadat a', | |
| 22 | pa th : '', | |
| 23 | ge t : getMet adata, | |
| 24 | su bsystems : [ 'author ization' ] , | |
| 25 | in terceptors : {}, | |
| 26 | pe rmitRespon seFormat : true, | |
| 27 | re quiredPerm issions : ['read-fhi r'], | |
| 28 | is PatientCen tric : fal se | |
| 29 | },{ | |
| 30 | na me : 'fhir -conforman ce-metadat a-search', | |
| 31 | pa th : '_sea rch', | |
| 32 | po st : getMe tadata, | |
| 33 | su bsystems : [ 'author ization' ] , | |
| 34 | in terceptors : {}, | |
| 35 | pe rmitRespon seFormat : true, | |
| 36 | re quiredPerm issions : ['read-fhi r'], | |
| 37 | is PatientCen tric : fal se | |
| 38 | }]; | |
| 39 | } | |
| 40 | ||
| 41 | //Issue ca ll to Conf ormance re gistration | |
| 42 | register(c onformance Utils.doma ins.CONFOR MANCE, cre ateConform anceData() ); | |
| 43 | ||
| 44 | function c reateConfo rmanceData () { | |
| 45 | var re sourceType = conform anceUtils. domains.CO NFORMANCE; | |
| 46 | var pr ofileRefer ence = 'ht tp://www.h l7.org/FHI R/2015May/ conformanc e.html'; | |
| 47 | var in teractions = [ 'read ', 'search -type' ]; | |
| 48 | ||
| 49 | return conforman ceUtils.cr eateConfor manceData( resourceTy pe, profil eReference , interact ions, fhir ToJDSAttrM ap); | |
| 50 | } | |
| 51 | ||
| 52 | function r egister(na me, data) { | |
| 53 | name = name.toLo werCase(); | |
| 54 | resour ceArray.pu sh({ | |
| 55 | na me : name, | |
| 56 | da ta : data | |
| 57 | }); | |
| 58 | } | |
| 59 | ||
| 60 | /** | |
| 61 | * @api {g et} /fhir/ metadata G et Conform ance | |
| 62 | * @apiNam e getConfo rmance | |
| 63 | * @apiGro up Conform ance | |
| 64 | * @apiPar am {String } [resourc e] retorce type. T | |
| 65 | * | |
| 66 | * @apiDes cription R eturns a F HIR \'Conf ormance\' report. | |
| 67 | * @apiExa mple {js} Request Ex amples: // Full conf ormance st atement | |
| 68 | * http:// IP /resource/ fhir/metad ata // Con formance f or a | |
| 69 | * resou rce(s) | |
| 70 | * http:// IP /resource/ fhir/metad ata?resour ce=observa tion[,pati ent] | |
| 71 | * | |
| 72 | * | |
| 73 | * @apiSuc cess {json } data Jso n object c onforming to the <a | |
| 74 | * href= "http://ww w.hl7.org/ FHIR/2015M ay/conform ance.html" >Conforman ce | |
| 75 | * FHIR DTSU2 spec ification< /a>. | |
| 76 | * @apiSuc cessExampl e Success- Response: | |
| 77 | * HTTP/ 1.1 200 OK | |
| 78 | * { } | |
| 79 | * @apiErr or (Error 400) Inval id paramet ers. | |
| 80 | * @apiErr orExample Error-Resp onse: | |
| 81 | * HTTP/ 1.1 400 Ba d Request | |
| 82 | * { } | |
| 83 | */ | |
| 84 | ||
| 85 | function g etMetadata (req, res) { | |
| 86 | var co nformance = packageR equestedSt atements(r eq); | |
| 87 | res.st atus(200). send(confo rmance); | |
| 88 | } | |
| 89 | ||
| 90 | function p ackageRequ estedState ments(req) { | |
| 91 | ||
| 92 | var re questedDom ain = req. param('res ource'); | |
| 93 | var co nformanceA rray; | |
| 94 | if (_. isEmpty(re questedDom ain)) { | |
| 95 | co nformanceA rray = res ourceArray ; | |
| 96 | } else { | |
| 97 | re questedDom ain = requ estedDomai n.toLowerC ase(); | |
| 98 | co nformanceA rray = _.f ilter(reso urceArray, function( o) { | |
| 99 | return r equestedDo main.index Of(o.name) !== -1; | |
| 100 | }) ; | |
| 101 | } | |
| 102 | ||
| 103 | var co nformanceD ata = _.so rtBy(confo rmanceArra y, functio n(o) { | |
| 104 | re turn o.nam e; | |
| 105 | }); | |
| 106 | var fi lter = []; | |
| 107 | ||
| 108 | var con formance = new fhirR esource.Co nformanceR esourceHea der('0.0.1 '); | |
| 109 | var out = conform ance.rest[ 0].resourc e; | |
| 110 | //out = []; // R equired if Conforman ceResource Header cac hed | |
| 111 | ||
| 112 | if (!n ullchecker .isNullish (req.param ('resource '))) { | |
| 113 | va r domains = req.para m('resourc e').toLowe rCase(); | |
| 114 | fi lter = dom ains.split (','); | |
| 115 | } | |
| 116 | ||
| 117 | _.each (conforman ceData, fu nction(ite m) { | |
| 118 | if (filter.l ength === 0 || filte r.indexOf( item.name) > -1) { | |
| 119 | out.push (item.data ); | |
| 120 | } | |
| 121 | }); | |
| 122 | ||
| 123 | return conforman ce; | |
| 124 | } | |
| 125 | ||
| 126 | module.exp orts.getRe sourceConf ig = getRe sourceConf ig; | |
| 127 | module.exp orts.regis ter = regi ster; | |
| 128 | module.exp orts.packa geRequeste dStatement s = packag eRequested Statements ; |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.