generated from PackagrIO/goweb-template
-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
working Aidbox/Health Samurai integration. We can now convert CCDA re…
…cords to FHIR.
- Loading branch information
Showing
7 changed files
with
128 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { PlatformService } from './platform.service'; | ||
|
||
describe('PlatformService', () => { | ||
let service: PlatformService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
service = TestBed.inject(PlatformService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {Inject, Injectable} from '@angular/core'; | ||
import {HTTP_CLIENT_TOKEN} from '../dependency-injection'; | ||
import {HttpClient} from '@angular/common/http'; | ||
import {Router} from '@angular/router'; | ||
import {AuthService} from './auth.service'; | ||
import {MedicalSourcesFilter} from './medical-sources-filter.service'; | ||
import {Observable} from 'rxjs'; | ||
import {LighthouseSourceSearch} from '../models/lighthouse/lighthouse-source-search'; | ||
import {environment} from '../../environments/environment'; | ||
import {ResponseWrapper} from '../models/response-wrapper'; | ||
import {map} from 'rxjs/operators'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class PlatformService { | ||
|
||
constructor(private _httpClient: HttpClient) {} | ||
|
||
public convertCcdaToFhir(ccdaFile: File): Observable<File> { | ||
if(!ccdaFile || ccdaFile.size === 0){ | ||
throw new Error("Invalid CCDA file") | ||
} | ||
|
||
const endpointUrl = new URL(`https://api.platform.fastenhealth.com/v1/app/ccda-to-fhir`); | ||
return this._httpClient.post<string>(endpointUrl.toString(), ccdaFile, { headers: {'Content-Type': 'application/cda+xml'} }) | ||
.pipe( | ||
map((responseJson: string) => { | ||
console.log("Converter RESPONSE", responseJson) | ||
return new File([JSON.stringify(responseJson)], ccdaFile.name + ".converted.json", {type: "application/json", lastModified: ccdaFile.lastModified || Date.now()}) | ||
}) | ||
); | ||
} | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.