Skip to content

Instantly share code, notes, and snippets.

@goncalotomas
Last active November 16, 2016 00:22
Show Gist options
  • Save goncalotomas/737fe7326078ab71c0fae55c5630d452 to your computer and use it in GitHub Desktop.
Save goncalotomas/737fe7326078ab71c0fae55c5630d452 to your computer and use it in GitHub Desktop.
List of FMK ops to paste in the console to see if everything werks.
%% facilities
fmk_core:create_facility(1,"Weill Cornell Medical Center","New York NY,USA","Hospital").
fmk_core:create_facility(2,"Florida Hospital Orlando","Orlando FL, USA","Hospital").
fmk_core:create_facility(3,"Jackson Memorial Hospital","Miami FL, USA","Hospital").
fmk_core:create_facility(4,"Baptist Medical Center","San Antonio TX, USA","Hospital").
fmk_core:create_facility(5,"Insert name of any dictator here","San Antonio TX, USA","Hospital").
%% integrity check
Facility1 = fmk_core:get_facility_by_id(1).
1 = facility:id(Facility1).
not_found = facility:prescriptions(Facility1).
Facility2 = fmk_core:get_facility_by_id(2).
"Florida Hospital Orlando" = facility:name(Facility2).
Facility3 = fmk_core:get_facility_by_id(3).
"Miami FL, USA" = facility:address(Facility3).
Facility4 = fmk_core:get_facility_by_id(4).
"Hospital" = facility:type(Facility4).
%% pharmacies
fmk_core:create_pharmacy(1,"Chai Pharmacy","Costa da Caparica, Portugal").
fmk_core:create_pharmacy(2,"Carlos Pharmacy","Costa da Caparica, Portugal").
fmk_core:create_pharmacy(3,"Definitely not an online scam!","Lisbon, Portugal").
Pharmacy1 = fmk_core:get_pharmacy_by_id(1).
1 = pharmacy:id(Pharmacy1).
not_found = pharmacy:prescriptions(Pharmacy1).
Pharmacy2 = fmk_core:get_pharmacy_by_id(2).
"Carlos Pharmacy" = pharmacy:name(Pharmacy2).
Pharmacy3 = fmk_core:get_pharmacy_by_id(3).
"Lisbon, Portugal" = pharmacy:address(Pharmacy3).
%% integrity check
fmk_core:create_staff(1,"Paula Pinto","Lisboa","Alergologia").
fmk_core:create_staff(2,"Gonçalo Tomás","Costa da Caparica","Shenanigans").
fmk_core:create_staff(3,"Tânia Pires","Pragal","Enfermagem").
%% integrity check
Staff1 = fmk_core:get_staff_by_id(1).
1 = staff:id(Staff1).
not_found = staff:prescriptions(Staff1).
Staff2 = fmk_core:get_staff_by_id(2).
"Gonçalo Tomás" = staff:name(Staff2).
"Costa da Caparica" = staff:address(Staff2).
Staff3 = fmk_core:get_staff_by_id(3).
"Enfermagem" = staff:speciality(Staff3).
%% patients
fmk_core:create_patient(1,"Goncalo Tomas","Almada").
fmk_core:create_patient(2,"Goncalo Tomas","Almada").
fmk_core:create_patient(3,"Goncalo Tomas","Almada").
%% integrity check
Patient1 = fmk_core:get_patient_by_id(1).
1 = patient:id(Patient1).
Patient2 = fmk_core:get_patient_by_id(2).
"Goncalo Tomas" = patient:name(Patient2).
Patient3 = fmk_core:get_patient_by_id(3).
"Almada" = patient:address(Patient3).
not_found = patient:prescriptions(Patient1).
not_found = patient:events(Patient2).
not_found = patient:treatments(Patient3).
fmk_core:create_treatment(1,2,2,2,"1/1/1111").
fmk_core:create_event(1,1,3,"1/1/1111","Something happened.").
fmk_core:create_prescription(1,2,2,2,2,"1/1/1111",["Adderall","Amitriptyline"]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment