@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.
Files changed (27) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/GETTINGSTARTED.md +42 -3
  3. package/dist/index.d.ts +3 -3
  4. package/dist/index.js +5 -5
  5. package/dist/library/BundleUtils/BundleUtils.d.ts +16 -0
  6. package/dist/library/BundleUtils/BundleUtils.js +24 -0
  7. package/dist/library/BundleUtils/BundleUtils.spec.js +47 -0
  8. package/dist/library/{ResourceUtilities/ResourceUtilities.d.ts → ResourceUtils/ResourceUtils.d.ts} +14 -2
  9. package/dist/library/ResourceUtils/ResourceUtils.js +120 -0
  10. package/dist/library/{ResourceUtilities/ResourceUtilities.spec.js → ResourceUtils/ResourceUtils.spec.js} +81 -22
  11. package/package.json +1 -1
  12. package/src/index.ts +3 -3
  13. package/src/library/BundleUtils/BundleUtils.spec.ts +65 -0
  14. package/src/library/BundleUtils/BundleUtils.ts +26 -0
  15. package/src/library/{ResourceUtilities/ResourceUtilities.spec.ts → ResourceUtils/ResourceUtils.spec.ts} +106 -24
  16. package/src/library/ResourceUtils/ResourceUtils.ts +128 -0
  17. package/src/test-resources/CareTeam-R4.json +85 -0
  18. package/src/test-resources/Patient-R4.json +6 -1
  19. package/dist/library/BundleUtilities/BundleUtilities.d.ts +0 -10
  20. package/dist/library/BundleUtilities/BundleUtilities.js +0 -16
  21. package/dist/library/BundleUtilities/BundleUtilities.spec.js +0 -26
  22. package/dist/library/ResourceUtilities/ResourceUtilities.js +0 -51
  23. package/src/library/BundleUtilities/BundleUtilities.spec.ts +0 -28
  24. package/src/library/BundleUtilities/BundleUtilities.ts +0 -16
  25. package/src/library/ResourceUtilities/ResourceUtilities.ts +0 -52
  26. /package/dist/library/{BundleUtilities/BundleUtilities.spec.d.ts → BundleUtils/BundleUtils.spec.d.ts} +0 -0
  27. /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();