Skip to content

Commit

Permalink
Merge pull request #261 from fastenhealth/eob_enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Oct 6, 2023
2 parents 1435bbf + aee2d5c commit b8cf1c2
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 6 deletions.
8 changes: 8 additions & 0 deletions frontend/src/lib/models/datatypes/identifier-model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {CodableConceptModel} from './codable-concept-model';

export interface IdentifierModel {
use: string
type?: CodableConceptModel
system?: string
value?: string
}
3 changes: 3 additions & 0 deletions frontend/src/lib/models/datatypes/reference-model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import {IdentifierModel} from './identifier-model';

export interface ReferenceModel {
reference: string
display?: string
identifier?: IdentifierModel
}
15 changes: 15 additions & 0 deletions frontend/src/lib/models/resources/explanation-of-benefit-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ import {fhirVersions, ResourceType} from '../constants';
import {FastenOptions} from '../fasten/fasten-options';
import * as _ from "lodash";
import {CodingModel} from '../datatypes/coding-model';
import * as fhirpath from 'fhirpath';

export class ExplanationOfBenefitModel extends FastenDisplayModel {
code: CodableConceptModel | undefined
code_text: string | undefined
code_id: string | undefined
code_system: string | undefined


disposition: string | undefined
created: string | undefined
Expand Down Expand Up @@ -96,6 +102,15 @@ export class ExplanationOfBenefitModel extends FastenDisplayModel {
};

r4DTO(fhirResource){
let principalDiagnosis = fhirpath.evaluate(fhirResource, "ExplanationOfBenefit.diagnosis.where(type.coding.code='principal').first().diagnosisCodeableConcept.first()")

if(principalDiagnosis.length > 0) {
this.code = principalDiagnosis[0] as CodableConceptModel
this.code_text = principalDiagnosis[0]?.coding?.display
this.code_id = principalDiagnosis[0]?.coding?.code
this.code_system = principalDiagnosis[0]?.coding?.system
}

this.type = _.get(fhirResource, 'type.coding', []);
this.hasType = Array.isArray(this.type) && this.type.length > 0;
this.resourceStatus = _.get(fhirResource, 'status');
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ require (
github.com/dave/jennifer v1.6.1
github.com/dominikbraun/graph v0.15.0
github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3
github.com/fastenhealth/fasten-sources v0.3.2
github.com/fastenhealth/gofhir-models v0.0.5
github.com/fastenhealth/fasten-sources v0.3.3
github.com/fastenhealth/gofhir-models v0.0.6
github.com/gin-gonic/gin v1.9.0
github.com/glebarez/sqlite v1.5.0
github.com/golang-jwt/jwt/v4 v4.4.2
Expand Down Expand Up @@ -111,3 +111,5 @@ require (
)

//replace github.com/fastenhealth/fasten-sources => ../fasten-sources
//
//replace github.com/fastenhealth/gofhir-models => ../gofhir-models
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi
github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M=
github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww=
github.com/fastenhealth/fasten-sources v0.3.2 h1:AdFayvwu88zO5JmMNhxlZDARZW1q6iBNHl9Ew8BSLHs=
github.com/fastenhealth/fasten-sources v0.3.2/go.mod h1:KUtpp65GaKlpRvl5i8zWTVZlI1yJaUPkvGVqQVEC21w=
github.com/fastenhealth/gofhir-models v0.0.5 h1:wU2Dz+/h9MzZCTRgkQzeq5l0EFuMI6C5xgCbKislFpg=
github.com/fastenhealth/gofhir-models v0.0.5/go.mod h1:xB8ikGxu3bUq2b1JYV+CZpHqBaLXpOizFR0eFBCunis=
github.com/fastenhealth/fasten-sources v0.3.3 h1:JI8fuXd6Cuq21T4aATLDS26Ubdy3foALFrQ/wa1Ylc8=
github.com/fastenhealth/fasten-sources v0.3.3/go.mod h1:YxgwR6jSEU+edYqEDkm238n7HlvZdW3i04nIh7gSDaM=
github.com/fastenhealth/gofhir-models v0.0.6 h1:yJYYaV1eJtHiGEfA1rXLsyOm/9hIi6s2cGoZzGfW1tM=
github.com/fastenhealth/gofhir-models v0.0.6/go.mod h1:xB8ikGxu3bUq2b1JYV+CZpHqBaLXpOizFR0eFBCunis=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
Expand Down

0 comments on commit b8cf1c2

Please sign in to comment.