Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanwilliammd committed May 1, 2024
1 parent d31e988 commit 9776e92
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
- Added ```fhir_utils.py``` function for ```fastapi.py``` data conversion
- Added ```fhir_parser.py``` function covering code extraction from FHIR Observation, Condition, and Bundle resources ```/fhir/parse/resource``` (singular resource) and ```/fhir/parse/bundle``` (bundle resource)
- Added FastAPI endpoint function triggering ```batchconvert``` function ```/iderare/batchconvert```

## [v0.5.0](https://github.com/ivanwilliammd/iderare-pheno/releases/tag/v0.5.0) - 2024-04-10
- Added ```omim2name``` function and ```streamlit_utils.py``` to accomodate Streamlit app
Expand Down
12 changes: 10 additions & 2 deletions iderare_pheno/fhir_utils.py → iderare_pheno/fhir_parser.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from typing import List, Union

from fastapi import FastAPI, HTTPException, Response
from fastapi import FastAPI, HTTPException, Request, Response
from pydantic import BaseModel

from iderare_pheno.converter import batchconvert

app = FastAPI()

class Coding(BaseModel):
Expand Down Expand Up @@ -89,4 +91,10 @@ async def fhir_batch_parse(bundle: Bundle) -> Response:

@app.post("/fhir/parse/resource")
async def fhir_parse(resource: Union[Observation, Condition]) -> Response:
return {"result" : resource_object(resource, resource.resourceType)}
return {"result" : resource_object(resource, resource.resourceType)}


@app.post("/iderare/batchconvert")
async def iderare_batch_convert(data: List[str]) -> Response:
hpo_sets, diagnosis_sets = batchconvert(data)
return {"hpo_sets" : hpo_sets, "diagnosis_sets" : diagnosis_sets}

0 comments on commit 9776e92

Please sign in to comment.