Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Nov 17, 2023
1 parent bb9cd53 commit dba5323
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/library/ResourceUtilities/ResourceUtilities.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as DSTU2 from "../../FHIR-DSTU2"
import * as R3 from "../../FHIR-R3"
import { Coding as r4Coding } from "../../FHIR-R4/classes/coding"
import { Extension as r4Extension } from "../../FHIR-R4/classes/extension"
import { Identifier as r4Identifier } from "../../FHIR-R4/classes/identifier"
import * as DSTU2 from "../../FHIR-DSTU2";
import * as R3 from "../../FHIR-R3";
import { Coding as r4Coding } from "../../FHIR-R4/classes/coding";
import { Extension as r4Extension } from "../../FHIR-R4/classes/extension";
import { Identifier as r4Identifier } from "../../FHIR-R4/classes/identifier";

type Identifier = r4Identifier & R3.Identifier & DSTU2.Identifier
type IdentifierKeys = keyof Identifier
type Extension = r4Extension & R3.Extension & DSTU2.Extension
type Coding = r4Coding & R3.Coding & DSTU2.Coding
type CodingKeys = keyof Coding
type Identifier = r4Identifier & R3.Identifier & DSTU2.Identifier;
type IdentifierKeys = keyof Identifier;
type Extension = r4Extension & R3.Extension & DSTU2.Extension;
type Coding = r4Coding & R3.Coding & DSTU2.Coding;
type CodingKeys = keyof Coding;
export class ResourceUtility {

/**
Expand All @@ -19,11 +19,11 @@ export class ResourceUtility {
* @limitation currently just supports get for top level property on resource
*/
getResourceProperty(inputJson: object, propertyName: string) {
let resourcePropertyValue = null
let resourcePropertyValue = null;
if (inputJson.hasOwnProperty(propertyName)) {
resourcePropertyValue = inputJson[propertyName]
resourcePropertyValue = inputJson[propertyName];
}
return resourcePropertyValue
return resourcePropertyValue;
}

/**
Expand All @@ -35,7 +35,7 @@ export class ResourceUtility {
* @limitations currently does not work with identifier.type, identifier.period & identifier.assigner
*/
getIdentifiersByProperty(identifierList: Identifier[], propertyToCompare: IdentifierKeys, propertyValue: Identifier[IdentifierKeys]): Identifier[] {
return identifierList?.length ? identifierList.filter(x => x[propertyToCompare] === propertyValue) : []
return identifierList?.length ? identifierList.filter(x => x[propertyToCompare] === propertyValue) : [];
}

/**
Expand All @@ -45,7 +45,7 @@ export class ResourceUtility {
* @returns array of matches
*/
getExtensionsByUrl(extensionList: Extension[], extensionUrl: string): Extension[] {
return extensionList?.length ? extensionList.filter(x => x.url === extensionUrl) : []
return extensionList?.length ? extensionList.filter(x => x.url === extensionUrl) : [];
}

/**
Expand All @@ -56,8 +56,8 @@ export class ResourceUtility {
* @returns array of matches
*/
getCodingsByProperty(codingList: Coding[], propertyToCompare: CodingKeys, propertyValue: Coding[CodingKeys]): Coding[] {
return codingList?.length ? codingList.filter(x => x[propertyToCompare] === propertyValue) : []
return codingList?.length ? codingList.filter(x => x[propertyToCompare] === propertyValue) : [];
}
}

export const ResourceUtilities = new ResourceUtility()
export const ResourceUtilities = new ResourceUtility();

0 comments on commit dba5323

Please sign in to comment.