-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
70 changed files
with
1,442 additions
and
150 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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,58 @@ | ||
import re | ||
|
||
|
||
# Open the PDF file | ||
def replace_unicode_character(input_string, character_to_replace, replacement_char): | ||
return input_string.replace(character_to_replace, replacement_char) | ||
|
||
|
||
def parse_html(html_content): | ||
new_html_content = [] | ||
endidx = -1 | ||
startidx = 0 | ||
pasr = html_content.split("\n") | ||
for idx, line in enumerate(pasr): | ||
line = replace_unicode_character(line, chr(61607) + " ", "*") | ||
line = replace_unicode_character(line, "• \n", "*") | ||
|
||
new_html_content.append(line) | ||
if "PATIENT INFORMATION LEAFLET" in line: # ema and UK | ||
# print(line) | ||
startidx = idx | ||
if ( | ||
"Detailed information on this medicine is available on the European Medicines Agency web site: " | ||
in line | ||
): | ||
# print(line) | ||
endidx = idx + 5 | ||
break | ||
print(startidx, endidx) | ||
return "\n".join(new_html_content[startidx:endidx]) | ||
|
||
|
||
def cleanhtml(raw_html): | ||
raw_html = re.sub(r"\*\n", "* ", raw_html) | ||
raw_html = re.sub(r"\d{2,3}\s\n", "", raw_html) | ||
|
||
raw_html = re.sub(r"(\d\.)\s\n", r"\1 ", raw_html) | ||
# raw_html = re.sub(r"\so\s", "* ", raw_html) | ||
raw_html = re.sub(r"-\s\n", "- ", raw_html) | ||
raw_html = re.sub(r"•\s\n", "* ", raw_html) | ||
|
||
return raw_html | ||
|
||
|
||
def split_parts(clean_content): | ||
second_part = re.findall( | ||
r"What is in this leaflet\S?\s{0,2}\n{1,2}\s{0,2}1. .+\n2. .+\n3. .+\n4. .+\n5. .+\n6. .+\n", | ||
clean_content, | ||
)[0] | ||
first_part = re.split( | ||
r"What is in this leaflet\S?\s{0,2}\n{1,2}\s{0,2}1. .+\n2. .+\n3. .+\n4. .+\n5. .+\n6. .+\n", | ||
clean_content, | ||
)[0] | ||
third_part = re.split( | ||
r"What is in this leaflet\S?\s{0,2}\n{1,2}\s{0,2}1. .+\n2. .+\n3. .+\n4. .+\n5. .+\n6. .+\n", | ||
clean_content, | ||
)[1] | ||
return first_part, second_part, third_part |
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
24 changes: 24 additions & 0 deletions
24
input/fsh/examples/rawEPI/calchichew-d3f-ema-automatic/AdministrableProductDefinition.fsh
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,24 @@ | ||
|
||
Instance: ap-a64c0ccb066e7fdf6ba2d86dcd8bda5e | ||
InstanceOf: AdministrableProductDefinitionUvEpi | ||
Title: "Administrable product Calcichew-D3 Forte" | ||
Description: "Administrable product Calcichew-D3 Forte" | ||
Usage: #inline | ||
|
||
* identifier.system = "https://spor.ema.europa.eu/pmswi" | ||
* identifier.value = "gh-1" | ||
|
||
* status = #active | ||
|
||
* formOf = Reference(mp04c5df8b1b688f62331c672bbd9ffa97) | ||
* administrableDoseForm = $spor-rms#100000073684 "Chewable tablet" | ||
* unitOfPresentation = $spor-rms#200000002152 "Tablet" | ||
|
||
|
||
|
||
* producedFrom = Reference(mid-a64c0ccb066e7fdf6ba2d86dcd8bda5e) | ||
|
||
|
||
* routeOfAdministration.code = $spor-rms#100000073619 "Oral use" | ||
|
||
* routeOfAdministration.targetSpecies.code = $spor-rms#100000109093 "Human" |
79 changes: 79 additions & 0 deletions
79
input/fsh/examples/rawEPI/calchichew-d3f-ema-automatic/Bundle.fsh
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,79 @@ | ||
|
||
|
||
|
||
RuleSet: 9e23fbe86c1f883dff598a2d9fed332eBundleRuleset | ||
|
||
|
||
|
||
|
||
|
||
// Ingredient | ||
* entry[+].fullUrl = "http://hl7.eu/fhir/ig/gravitate-health/Ingredient/ingredient-for-calchichewd3f-calciumcarbonate" | ||
* entry[=].resource = ingredient-for-calchichewd3f-calciumcarbonate | ||
|
||
|
||
// Ingredient | ||
* entry[+].fullUrl = "http://hl7.eu/fhir/ig/gravitate-health/Ingredient/ingredient-for-calchichewd3f-cholecalciferol" | ||
* entry[=].resource = ingredient-for-calchichewd3f-cholecalciferol | ||
|
||
|
||
// AdministrableProductDefinition | ||
* entry[+].fullUrl = "http://hl7.eu/fhir/ig/gravitate-health/AdministrableProductDefinition/ap-a64c0ccb066e7fdf6ba2d86dcd8bda5e" | ||
* entry[=].resource = ap-a64c0ccb066e7fdf6ba2d86dcd8bda5e | ||
|
||
|
||
// RegulatedAuthorization | ||
* entry[+].fullUrl = "http://hl7.eu/fhir/ig/gravitate-health/RegulatedAuthorization/authorizationa64c0ccb066e7fdf6ba2d86dcd8bda5e0" | ||
* entry[=].resource = authorizationa64c0ccb066e7fdf6ba2d86dcd8bda5e0 | ||
|
||
|
||
// Organization | ||
* entry[+].fullUrl = "http://hl7.eu/fhir/ig/gravitate-health/Organization/mah-d21dfe8c15312e8b8bf0b7774b510a9d" | ||
* entry[=].resource = mah-d21dfe8c15312e8b8bf0b7774b510a9d | ||
|
||
|
||
// PackagedProductDefinition | ||
* entry[+].fullUrl = "http://hl7.eu/fhir/ig/gravitate-health/PackagedProductDefinition/ppd-a46ff5cb1a9568d59a1669fd597f58bf" | ||
* entry[=].resource = ppd-a46ff5cb1a9568d59a1669fd597f58bf | ||
|
||
|
||
// MedicinalProductDefinition | ||
* entry[+].fullUrl = "http://hl7.eu/fhir/ig/gravitate-health/MedicinalProductDefinition/mp04c5df8b1b688f62331c672bbd9ffa97" | ||
* entry[=].resource = mp04c5df8b1b688f62331c672bbd9ffa97 | ||
|
||
|
||
|
||
|
||
|
||
// ManufacturedItemDefinition | ||
* entry[+].fullUrl = "http://hl7.eu/fhir/ig/gravitate-health/ManufacturedItemDefinition/mid-a64c0ccb066e7fdf6ba2d86dcd8bda5e" | ||
* entry[=].resource = mid-a64c0ccb066e7fdf6ba2d86dcd8bda5e | ||
|
||
|
||
|
||
|
||
|
||
Instance: bundlepackageleaflet-en-a64c0ccb066e7fdf6ba2d86dcd8bda5e | ||
InstanceOf: BundleUvEpi | ||
Title: "ePI document Bundle for Calcichew-D3 Forte Package Leaflet for language en" | ||
Description: "ePI document Bundle for Calcichew-D3 Forte Package Leaflet for language en" | ||
Usage: #example | ||
|
||
|
||
|
||
|
||
* identifier.system = "https://www.gravitatehealth.eu/sid/doc" | ||
* identifier.value = "gh-1" | ||
* type = #document | ||
* timestamp = "2023-06-27T10:09:22Z" | ||
* language = #en | ||
|
||
|
||
|
||
|
||
|
||
// Composition | ||
* entry[0].fullUrl = "http://hl7.eu/fhir/ig/gravitate-health/Composition/composition-en-04c5df8b1b688f62331c672bbd9ffa97" | ||
* entry[0].resource = composition-en-04c5df8b1b688f62331c672bbd9ffa97 | ||
|
||
* insert 9e23fbe86c1f883dff598a2d9fed332eBundleRuleset |
Empty file.
66 changes: 66 additions & 0 deletions
66
input/fsh/examples/rawEPI/calchichew-d3f-ema-automatic/Ingredient.fsh
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,66 @@ | ||
|
||
|
||
Instance: ingredient-for-calchichewd3f-calciumcarbonate | ||
|
||
InstanceOf: IngredientUvEpi | ||
Title: "Ingredient-active Calcium Carbonate" | ||
Description: "Calcium Carbonate" | ||
Usage: #inline | ||
|
||
* identifier.system = $ginas | ||
* identifier.value = "H0G9379FGK" | ||
* identifier.use = #official | ||
|
||
* role = $spor-rms#100000072072 "Active" | ||
|
||
* status = #active | ||
|
||
* substance.code.concept.coding = $ginas#H0G9379FGK "Calcium Carbonate" | ||
|
||
|
||
* substance.strength.presentationQuantity = 2500 'mg' | ||
|
||
* substance.strength.basis = http://terminology.hl7.org/CodeSystem/v3-RoleClass#ACTIB "active ingredient - basis of strength" | ||
|
||
|
||
// Reference to products | ||
* for = Reference(mid-a64c0ccb066e7fdf6ba2d86dcd8bda5e) | ||
* for[+] = Reference(mp04c5df8b1b688f62331c672bbd9ffa97) | ||
* for[+] = Reference(ap-a64c0ccb066e7fdf6ba2d86dcd8bda5e) | ||
|
||
|
||
|
||
//* manufacturer.manufacturer = Reference(mah-d21dfe8c15312e8b8bf0b7774b510a9d) | ||
|
||
|
||
Instance: ingredient-for-calchichewd3f-cholecalciferol | ||
|
||
InstanceOf: IngredientUvEpi | ||
Title: "Ingredient-active cholecalciferol" | ||
Description: "cholecalciferol" | ||
Usage: #inline | ||
|
||
* identifier.system = $ginas | ||
* identifier.value = "1C6V77QF41" | ||
* identifier.use = #official | ||
|
||
* role = $spor-rms#100000072072 "Active" | ||
|
||
* status = #active | ||
|
||
* substance.code.concept.coding = $ginas#1C6V77QF41 "cholecalciferol" | ||
|
||
|
||
* substance.strength.presentationQuantity = 22 'ug' | ||
|
||
* substance.strength.basis = http://terminology.hl7.org/CodeSystem/v3-RoleClass#ACTIB "active ingredient - basis of strength" | ||
|
||
|
||
// Reference to products | ||
* for = Reference(mid-a64c0ccb066e7fdf6ba2d86dcd8bda5e) | ||
* for[+] = Reference(mp04c5df8b1b688f62331c672bbd9ffa97) | ||
* for[+] = Reference(ap-a64c0ccb066e7fdf6ba2d86dcd8bda5e) | ||
|
||
|
||
|
||
//* manufacturer.manufacturer = Reference(mah-d21dfe8c15312e8b8bf0b7774b510a9d) |
Empty file.
21 changes: 21 additions & 0 deletions
21
input/fsh/examples/rawEPI/calchichew-d3f-ema-automatic/ManufacturedItemDefinition.fsh
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,21 @@ | ||
|
||
Instance: mid-a64c0ccb066e7fdf6ba2d86dcd8bda5e | ||
InstanceOf: ManufacturedItemDefinitionUvEpi | ||
Title: "Manufactured item Calcichew-D3 Forte" | ||
Description: "Manufactured item Calcichew-D3 Forte" | ||
Usage: #inline | ||
|
||
* identifier.system = "https://spor.ema.europa.eu/pmswi" | ||
* identifier.value = "gh-1" | ||
* identifier.use = #official | ||
|
||
* status = #active | ||
* manufacturedDoseForm = https://spor.ema.europa.eu/rmswi/#100000073684 "Chewable tablet" | ||
|
||
* unitOfPresentation = $spor-rms#200000002152 "Tablet" | ||
|
||
|
||
|
||
|
||
|
||
//* manufacturer = Reference(mah-d21dfe8c15312e8b8bf0b7774b510a9d) |
Oops, something went wrong.