Produced by Araxis Merge on 4/18/2019 5:55:13 PM Eastern 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 | MCCF_EDI_TAS_TASCore v2.0_Build_10.zip\MCCF_EDI_TAS_API_Core\src\tas\test | jmespath.js | Wed Apr 3 02:27:56 2019 UTC |
2 | MCCF_EDI_TAS_TASCore v2.0_Build_10.zip\MCCF_EDI_TAS_API_Core\src\tas\test | jmespath.js | Mon Apr 15 17:59:44 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 3 | 90 |
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 | ||
3 | const expe ct = requi re('chai') .expect | |
4 | const asse rt = requi re('chai') .assert | |
5 | ||
6 | const $tas = require ('..')() | |
7 | ||
8 | describe(" jmespath", function () { | |
9 | it("ch ecks websi te example s", async () => { | |
10 | ex pect($tas. helpers.jm espath.sea rch({ foo: { bar: { baz: [0, 1 , 2, 3, 4] } } }, "f oo.bar.baz [2]")).to. eql(2) | |
11 | ||
12 | ex pect($tas. helpers.jm espath.sea rch({ foo: { bar: { baz: [0, 1 , 2, 3, 4] } } }, "f oo.bar")). to.eql({ b az: [0, 1, 2, 3, 4] }) | |
13 | ||
14 | ex pect($tas. helpers.jm espath.sea rch({ | |
15 | "foo": [ { "first": "a", "las t": "b" }, | |
16 | { "first ": "c", "l ast": "d" }] | |
17 | }, "foo[*].f irst")).to .eql(['a', 'c']) | |
18 | ||
19 | ex pect($tas. helpers.jm espath.sea rch({ | |
20 | "foo": [ { "age": 2 0 }, { "ag e": 25 }, | |
21 | { "age": 30 }, { " age": 35 } , | |
22 | { "age": 40 }] | |
23 | }, "foo[?age > `30`]") ).to.eql([ { age: 35 }, { age: 40 }]) | |
24 | }) | |
25 | ||
26 | it("lo ad fhir ad judication from clai mResponse" , async () => { | |
27 | const clai mResponseD ata = { "r esourceTyp e": "Bundl e", "id": "cf6da442- 2169-4dfe- 832d-17df0 c88f6d9", "meta": { "lastUpdat ed": "2018 -05-15T13: 59:43.633- 04:00" }, "type": "s earchset", "total": 1, "link": [{ "relat ion": "sel f", "url": "https:// DNS . URL /VA-FHIR-S erver/fhir /ClaimResp onse?_form at=json&_i d=1&locati on=001" }] , "entry": [{ "fullU rl": "http s:// DNS . URL /VA-FHIR-S erver/fhir /ClaimResp onse/1", " resource": { "resour ceType": " ClaimRespo nse", "id" : "1", "ex tension": [{ "url": "PAPER_EOB _ENTRY", " valueBoole an": false }, { "url ": "PAYER_ ID", "valu eReference ": { "refe rence": "O rganizatio n/1" } }, { "url": " INDIVIDUAL _EOB_COUNT ", "valueS tring": "4 " }, { "ur l": "DATE_ TIME_PROCE SSED", "va lueDate": "2017-12-1 8" }, { "u rl": "DATE _EDITED", "valueDate ": "2017-1 0-11" }, { "url": "O LD_STATUS" , "valueSt ring": "PA RTIAL" }, { "url": " NEW_STATUS ", "valueS tring": "P ARTIAL" }, { "url": "dateRange 2", "value Date": "20 17-04-17" }, { "url" : "dateRan ge3", "val ueDate": " 2017-10-11 " }], "ide ntifier": [{ "system ": "urn:va :vista:cla imresponse ", "value" : "1" }, { "system": "urn:va:v ista:trace number", " value": "1 23" }, { " system": " urn:va:vis ta:tracenu mber2", "v alue": "12 3" }, { "s ystem": "u rn:va:vist a:eranumbe r", "value ": "1" }, { "system" : "urn:va: vista:trac enumber", "value": " 1" }], "cr eated": "2 017-04-17T 13:59:43-0 4:00", "re quest": { "reference ": "Claim/ 3" }, "dis position": "UNMATCHE D", "item" : [{ "sequ enceLinkId ": 1, "adj udication" : [{ "cate gory": { " coding": [ { "code": "EXAMPLE" }] }, "rea son": { "c oding": [{ "code": " ALL IN THE FAMILY", "display": "THIS IS THE REAL R EASON" }] }, "amount ": { "valu e": 1212.0 , "unit": "USD", "sy stem": "ur n:iso:std: iso:4217", "code": " USD" }, "v alue": 3.0 }] }], "p ayment": { "extensio n": [{ "ur l": "amoun t2", "valu eMoney": { "value": 50.0, "uni t": "USD", "system": "urn:iso: std:iso:42 17", "code ": "USD" } }, { "url ": "amount 3", "value Money": { "value": 5 0.0, "unit ": "USD", "system": "urn:iso:s td:iso:421 7", "code" : "USD" } }, { "url" : "dateRec eived", "v alueDate": "2017-04- 17" }, { " url": "dat ePosted", "valueDate ": "2017-0 4-17" }, { "url": "P aymentIEN" , "valueId entifier": { "system ": "urn:va :vista:ien ", "value" : "1" } }, { "url": "ReceiptNo 2", "value Identifier ": { "syst em": "urn: va:vista:r eceipt", " value": "B 222222" } }], "amoun t": { "val ue": 50.0, "unit": " USD", "sys tem": "urn :iso:std:i so:4217", "code": "U SD" }, "id entifier": { "system ": "urn:va :vista:eft transactio n", "value ": "1" } } , "process Note": [{ "text": "o ldstatusch nged" }] } }] } | |
28 | co nst adjudi cation = $ tas.helper s.jmespath .search(cl aimRespons eData, "en try[*].res ource[].it em[].adjud ication") | |
29 | ex pect(adjud ication.le ngth).to.e q(1) | |
30 | ex pect(adjud ication[0] .length).t o.eq(1) | |
31 | ex pect(Objec t.keys(adj udication[ 0][0]).len gth).to.eq (4) | |
32 | }) | |
33 | ||
34 | it("se arch", asy nc () => { | |
35 | const data = { "reso urceType": "Bundle", "id": "2f 174746-f08 a-466b-8fd 3-1fa9ef37 edb7", "me ta": { "la stUpdated" : "2018-05 -14T14:13: 27.829-04: 00" }, "ty pe": "tran saction", "link": [{ "relation ": "self", "url": "h ttps:// DNS . URL /VA-FHIR-S erver/fhir /Bundle?_i d=1&locati on=001&tra nsaction=2 70" }], "e ntry": [{ "extension ": [{ "url ": "segmen t", "value String": " 270-MSH-Me ssageHeade r" }], "re source": { "resource Type": "Me ssageHeade r", "id": "ID", "eve nt": { "co de": "EVEN T" }, "des tination": [{ "name" : "DESTINA TION" }], "timestamp ": "2018-0 5-14T14:13 :27.737-04 :00", "sou rce": { "v ersion": " 2.4" }, "r eason": { "coding": [{ "code": "I01" }] } } }, { " extension" : [{ "url" : "segment ", "valueS tring": "2 70-MSH-Mes sageHeader " }], "res ource": { "resourceT ype": "Loc ation", "i dentifier" : [{ "exte nsion": [{ "url": "s equence", "valueStri ng": "270- MSH-4-Send ingFacilit y" }], "ty pe": { "co ding": [{ "code": "D NS" }] }, "system": "SOFTWARE SERVICE", "value": " FOIA.DOMAI N.EXT" }, { "extensi on": [{ "u rl": "sequ ence", "va lueString" : "270-MSH -5-Receivi ngApplicat ion" }], " system": " IIV EC" }, { "extens ion": [{ " url": "seq uence", "v alueString ": "270-MS H-6-Receiv ingFacilit y" }], "ty pe": { "co ding": [{ "code": "D NS" }] }, "system": "SYSTEM" } ], "addres s": { "cou ntry": "US A" } } }, { "extensi on": [{ "u rl": "segm ent", "val ueString": "270-MSH- MessageHea der" }], " resource": { "resour ceType": " ProcessReq uest", "id entifier": [{ "value ": "produc tion" }] } }, { "ext ension": [ { "url": " segment", "valueStri ng": "270- MSH-Messag eHeader" } ], "resour ce": { "re sourceType ": "Basic" , "extensi on": [{ "u rl": "sequ ence", "va lueString" : "270-MSH -15-Accept Acknowledg ment" }] } }, { "ext ension": [ { "url": " segment", "valueStri ng": "270- MSH-Messag eHeader" } ], "resour ce": { "re sourceType ": "Basic" , "extensi on": [{ "u rl": "sequ ence", "va lueString" : "270-MSH -16-Applic ationAckno wledgmentT ype" }], " code": { " coding": [ { "code": "NE" }] } } }, { "ex tension": [{ "url": "segment", "valueStr ing": "270 -PRD-Provi derData" } ], "resour ce": { "re sourceType ": "Practi tionerRole ", "identi fier": [{ "value": " N/A" }] } }, { "exte nsion": [{ "url": "s egment", " valueStrin g": "270-P ID-Patient Identifica tion" }], "resource" : { "resou rceType": "Basic", " extension" : [{ "url" : "sequenc e", "value String": " 270-PID-1- SetIDPID" }], "ident ifier": [{ "value": "1" }] } } , { "exten sion": [{ "url": "se gment", "v alueString ": "270-PI D-PatientI dentificat ion" }], " resource": { "resour ceType": " Basic", "e xtension": [{ "url": "sequence ", "valueS tring": "2 70-PID-3-P atientIden tifierList " }], "ide ntifier": [{ "value" : "VALUE" }], "code" : { "codin g": [{ "co de": "CODE " }] } } } , { "exten sion": [{ "url": "se gment", "v alueString ": "270-PI D-PatientI dentificat ion" }], " resource": { "resour ceType": " Basic", "e xtension": [{ "url": "sequence ", "valueS tring": "2 70-PID-10- Race" }], "code": { "coding": [{ "code": "RACE" }] } } }, { "extension ": [{ "url ": "segmen t", "value String": " 270-PID-Pa tientIdent ification" }], "reso urce": { " resourceTy pe": "Basi c", "creat ed": "2018 -05-14" } }, { "exte nsion": [{ "url": "s egment", " valueStrin g": "270-G T1-Guarant or" }], "r esource": { "resourc eType": "B asic", "cr eated": "2 018-05-14" } }, { "e xtension": [{ "url": "segment" , "valueSt ring": "27 0-PID-Pati entIdentif ication" } ], "resour ce": { "re sourceType ": "Patien t", "text" : { "statu s": "gener ated", "di v": "<div xmlns=\"ht tp://www.w 3.org/1999 /xhtml\">< div class= \"hapiHead erText\">D R SIR PATI ENT N <b>F OURTEEN </ b> PHD MS< /div><tabl e class=\" hapiProper tyTable\"> <tbody><tr ><td>Ident ifier</td> <td/></tr> <tr><td>Ad dress</td> <td><span> 23 MAIN ST </span><b r/><span>A PT 3B </sp an><br/><s pan>BOSTON </span><s pan>NEW YO RK </span> </td></tr> <tr><td>Da te of birt h</td><td> <span>14 M ay 2018</s pan></td>< /tr></tbod y></table> </div>" }, "identifi er": [{ "e xtension": [{ "url": "sequence ", "valueS tring": "2 70-PID-3-P atientIden tifierList " }], "typ e": { "cod ing": [{ " code": "NI " }] } }, { "extensi on": [{ "u rl": "sequ ence", "va lueString" : "270-PID -19-SSN" } ] }], "nam e": [{ "ex tension": [{ "url": "sequence" , "valueSt ring": "27 0-PID-5-Pa tientName" }], "fami ly": "FOUR TEEN", "gi ven": ["PA TIENT", "N "], "prefi x": ["DR", "SIR"], " suffix": [ "PHD", "MS "] }, { "e xtension": [{ "url": "sequence ", "valueS tring": "2 70-PID-9-P atientAlia s" }], "fa mily": "AL IAS" }], " gender": " male", "bi rthDate": "2018-05-1 4", "addre ss": [{ "l ine": ["23 MAIN ST", "APT 3B"] , "city": "BOSTON", "state": " NEW YORK" }] } }, { "extension ": [{ "url ": "segmen t", "value String": " 270-PID-Pa tientIdent ification" }], "reso urce": { " resourceTy pe": "Orga nization", "extensio n": [{ "ur l": "seque nce", "val ueString": "270-PID- 3.4.1-Assi gningAutho rity" }], "identifie r": [{ "va lue": "USV HA" }] } } , { "exten sion": [{ "url": "se gment", "v alueString ": "270-PI D-PatientI dentificat ion" }], " resource": { "resour ceType": " Organizati on", "exte nsion": [{ "url": "s equence", "valueStri ng": "270- PID-3.6.1- Identifier CodeType" }], "ident ifier": [{ "value": "SOFTWARE SERVICE" } ] } }, { " extension" : [{ "url" : "segment ", "valueS tring": "2 70-GT1-Gua rantor" }] , "resourc e": { "res ourceType" : "Related Person", " identifier ": [{ "ext ension": [ { "url": " sequence", "valueStr ing": "270 -GT1-2.1-I D" }], "ty pe": { "co ding": [{ "code": "C ODE_ONE" } ] }, "valu e": "ID_ON E" }, { "e xtension": [{ "url": "sequence ", "valueS tring": "2 70-GT1-2.2 -CheckDigi t" }], "ty pe": { "co ding": [{ "code": "C ODE_ONE" } ] }, "valu e": "ID_TW O" }], "na me": [{ "f amily": "F amily", "g iven": ["G iven_1", " Given_2"], "prefix": ["DR", "S IR"], "suf fix": ["PH D", "MS"] }], "gende r": "femal e", "birth Date": "20 18-05-14", "address" : [{ "line ": ["1425 Main Stree t", "Suite 123"], "c ity": "Riv erview", " state": "F L", "posta lCode": "3 3578", "co untry": "U SA" }] } } ] } | |
36 | ||
37 | le t names = $tas.helpe rs.array.d istinct($t as.helpers .jmespath. search(dat a, "entry[ *].resourc e.resource Type | sor t(@)")) | |
38 | ex pect(names .length).t o.eq(8) | |
39 | ||
40 | le t groups = Object.as sign({}, . ..names.ma p(p => { | |
41 | return { | |
42 | [p]: $tas.help ers.jmespa th.search( data, `ent ry[?resour ce.resourc eType=='${ p}']`) | |
43 | } | |
44 | }) ) | |
45 | ex pect(Objec t.keys(gro ups).lengt h).to.eq(8 ) | |
46 | }) | |
47 | }) |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.