@smile-cdr/fhirts 2.0.7 → 2.1.1
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.
- package/CHANGELOG.md +8 -0
- package/GETTINGSTARTED.md +42 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -5
- package/dist/library/BundleUtils/BundleUtils.d.ts +16 -0
- package/dist/library/BundleUtils/BundleUtils.js +24 -0
- package/dist/library/BundleUtils/BundleUtils.spec.js +47 -0
- package/dist/library/{ResourceUtilities/ResourceUtilities.d.ts → ResourceUtils/ResourceUtils.d.ts} +14 -2
- package/dist/library/ResourceUtils/ResourceUtils.js +120 -0
- package/dist/library/{ResourceUtilities/ResourceUtilities.spec.js → ResourceUtils/ResourceUtils.spec.js} +81 -22
- package/package.json +1 -1
- package/src/index.ts +3 -3
- package/src/library/BundleUtils/BundleUtils.spec.ts +65 -0
- package/src/library/BundleUtils/BundleUtils.ts +26 -0
- package/src/library/{ResourceUtilities/ResourceUtilities.spec.ts → ResourceUtils/ResourceUtils.spec.ts} +106 -24
- package/src/library/ResourceUtils/ResourceUtils.ts +128 -0
- package/src/test-resources/CareTeam-R4.json +85 -0
- package/src/test-resources/Patient-R4.json +6 -1
- package/dist/library/BundleUtilities/BundleUtilities.d.ts +0 -10
- package/dist/library/BundleUtilities/BundleUtilities.js +0 -16
- package/dist/library/BundleUtilities/BundleUtilities.spec.js +0 -26
- package/dist/library/ResourceUtilities/ResourceUtilities.js +0 -51
- package/src/library/BundleUtilities/BundleUtilities.spec.ts +0 -28
- package/src/library/BundleUtilities/BundleUtilities.ts +0 -16
- package/src/library/ResourceUtilities/ResourceUtilities.ts +0 -52
- /package/dist/library/{BundleUtilities/BundleUtilities.spec.d.ts → BundleUtils/BundleUtils.spec.d.ts} +0 -0
- /package/dist/library/{ResourceUtilities/ResourceUtilities.spec.d.ts → ResourceUtils/ResourceUtils.spec.d.ts} +0 -0
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export class ResourceUtility {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param inputJson - valid json
|
|
6
|
-
* @param propertyName - top level property for resource
|
|
7
|
-
* @returns json property if it exists
|
|
8
|
-
* @limitation currently just supports get for top level property on resource
|
|
9
|
-
*/
|
|
10
|
-
getResourceProperty(inputJson: object, propertyName: string) {
|
|
11
|
-
let resourcePropertyValue = null;
|
|
12
|
-
if (inputJson.hasOwnProperty(propertyName)) {
|
|
13
|
-
resourcePropertyValue = inputJson[propertyName];
|
|
14
|
-
}
|
|
15
|
-
return resourcePropertyValue;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @param identifierList list of identifiers
|
|
21
|
-
* @param propertyToCompare identifier property to compare
|
|
22
|
-
* @param propertyValue value we want to compare against
|
|
23
|
-
* @returns array of matches
|
|
24
|
-
* @limitations currently does not work with identifier.type, identifier.period & identifier.assigner
|
|
25
|
-
*/
|
|
26
|
-
getIdentifiersByProperty(identifierList: any[], propertyToCompare: string, propertyValue: string): any[] {
|
|
27
|
-
return identifierList?.length ? identifierList.filter(x => x[propertyToCompare] === propertyValue): [];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @param extensionList list of extensions
|
|
33
|
-
* @param extensionUrl Extension.url to compare
|
|
34
|
-
* @returns array of matches
|
|
35
|
-
*/
|
|
36
|
-
getExtensionsByUrl(extensionList: any[], extensionUrl: string): any[] {
|
|
37
|
-
return extensionList?.length ? extensionList.filter(x => x['url'] === extensionUrl) : [];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @param codingList list of codings
|
|
43
|
-
* @param propertyToCompare coding property to compare
|
|
44
|
-
* @param propertyValue value we want to compare against string or boolean
|
|
45
|
-
* @returns array of matches
|
|
46
|
-
*/
|
|
47
|
-
getCodingsByProperty(codingList: any[], propertyToCompare: string, propertyValue: string | boolean): any[] {
|
|
48
|
-
return codingList?.length ? codingList.filter(x => x[propertyToCompare] === propertyValue) : [];
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export const ResourceUtilities = new ResourceUtility();
|
|
File without changes
|
|
File without changes
|