Fhir-HepatitisC-Predict
Processing FHIR resources with FHIR SQL BUILDER to predict the probability of developing hepatitis C disease
With the development of technology, the medical industry is also constantly advancing, and humans often pay more attention to their own health,
By learning and processing datasets through computers, diseases can be predicted.
Pre condition: Ability to use FHIR and ML
Firstly, our dataset is obtained from kaggle and transformed into FHIR resources based on patient gender, age, ALP or ALT, and imported into the FHIR resource repository
To import the FHIR resource repository, we can use this command:
Set sc=##class(HS.FHIRServer.Tools.DataLoader).SubmitResourceFiles("/usr/local/src/json/","FHIRSERVER","/csp/healthshare/fhirserver/fhir/r4")Among them, the file address and fhir resource repository URL can be modified according to the situation.
.png)
After completing the import, the next step is to configure FHIR SQL Builder, including FHIR Analysis, conversion rules, and Projections
.png)
Configure conversion rules, which are very important. They can obtain the data you want, and some sensitive information of patients can also be omitted, ensuring data security
.png)
After configuration is completed, create a projection to query the corresponding table in the database
.png)
After the projection is created, summarize the tables into the required structure for training by creating tables or views
createview T2.HepatitisData ASSELECT
TP.ID, TP.BirthDate, DATEDIFF(yy,TP.BirthDate,Now()) AGE, TP.Gender, TP.Key,
GH.CodeText GHCodeText, GH.ValueBoolean GHGHValueBoolean,
ALB.ValueQuantityValue ALBValueQuantityValue,
ALP.ValueQuantityValue ALPValueQuantityValue,
ALT.ValueQuantityValue ALTValueQuantityValue,
AST.ValueQuantityValue ASTValueQuantityValue,
BIL.ValueQuantityValue BILValueQuantityValue,
CHE.ValueQuantityValue CHEValueQuantityValue,
CHOL.ValueQuantityValue CHOLValueQuantityValue,
CREA.ValueQuantityValue CREAValueQuantityValue,
GGT.ValueQuantityValue GGTValueQuantityValue,
PROT.ValueQuantityValue
FROM
T2.Patient TP
INNERJOIN T2.Observation GH ON TP.Key = GH.SubjectReference AND GH.CodeCodingCode = '8310-5'INNERJOIN T2.Observation ALB ON TP.Key = ALB.SubjectReference AND ALB.CodeCodingCode = '1751-7'INNERJOIN T2.Observation ALP ON TP.Key = ALP.SubjectReference AND ALP.CodeCodingCode = '6768-6'INNERJOIN T2.Observation ALT ON TP.Key = ALT.SubjectReference AND ALT.CodeCodingCode = '29463-7'INNERJOIN T2.Observation AST ON TP.Key = AST.SubjectReference AND AST.CodeCodingCode = '2345-7'INNERJOIN T2.Observation BIL ON TP.Key = BIL.SubjectReference AND BIL.CodeCodingCode = '1975-2'INNERJOIN T2.Observation CHE ON TP.Key = CHE.SubjectReference AND CHE.CodeCodingCode = '1920-8'INNERJOIN T2.Observation CHOL ON TP.Key = CHOL.SubjectReference AND CHOL.CodeCodingCode = '2093-3'INNERJOIN T2.Observation CREA ON TP.Key = CREA.SubjectReference AND CREA.CodeCodingCode = '2160-0'INNERJOIN T2.Observation GGT ON TP.Key = GGT.SubjectReference AND GGT.CodeCodingCode = '2324-2'INNERJOIN T2.Observation PROT ON TP.Key = PROT.SubjectReference AND PROT.CodeCodingCode = '2885-2'Create Model
CREATEMODEL Hepatitis PREDICTING (GHCodeText) WITH ( AGE int, Gender string, GHGHValueBoolean boolean, ALBValueQuantityValue double, ALPValueQuantityValue double, ALTValueQuantityValue double, ASTValueQuantityValue double, BILValueQuantityValue double, CHEValueQuantityValue double, CHOLValueQuantityValue double, CREAValueQuantityValue double, GGTValueQuantityValue double, ValueQuantityValue double) FROM T2.HepatitisData Training model
TRAIN model HepatitisAfter the training is completed, we can use this model for HepatitisC prediction, which is the application interface,
- After the configuration is completed, initialization will be carried out, and the dataset in HepatitsCdata.csv will be processed into FHIR resources and imported
- Show can display the normal range of input check results
- After completing all inputs, click on the prediction button to convert the filled information into fhir resources and store them in the FHIR resource repository through the API. This allows for result prediction of Hepatitis C diseases
.png)