Export data from FM

EHR prevously running FM may export data from FM to the dedicated SFM migration format. The encryption of data is relying on a dedicated certificate available from Adresseregisteret under Norsk Helsenett SF: SFM migrering

When the (encryption) certificate is properly installed, the FM export progam may be started. Login is same as in FM-Admin:

Autentiser bruker

The export client will ask for the file path and the certificate to use:

FM export dialog

Exoprted data files

The files from FM export consist of differenet types

  • organizational data, only one file. Contains organizational information, user info (healtcare and adming, local medication registration etc.)
  • Patient data. Several files in a strucutre. One file per patient, containing treatements, prescriptions, GP info, allergies.
  • Reports. Several files in a strucutre. Contains unstrucured data in pdf, refering to particuar patients.
  • Index. Contains the relative path to all the patient files to upload.

Import data to SFM

Using the available application SFMUploader the FM data may now be transferred to SFM Migration API. The SFM uploader starts as a command line program with the access token as parameter. It is wise to have this integrated into the EHR support module, doing a proper login and retreive the bearer token with scope SFM migrering.

SFMUploader program

After successfully starting the SFMUploader it asks for the folder to select (mappe). The button Start opplasting starts the upload. SFMUploader will recod what files are successfully uploaded, and may be restarted in case of errors. SFM will require a valid token when upload starts, but will accept uploading process to last for a few hours beyond the token expiration.

Upload result

When uplad is finished, the program writes a report to the folder (extension .ledger`). The log shall be inspected for result.

Extract of a ledger file from test:

{
  "importFiles": [
    {
      "FileNameWithRelativePath": "ExportData.dat",
      "FileName": "ExportData.dat",
      "FileType": "organizationFile",
      "Status": "completed",
      "RemoteUrl": "https://dataimport.test1.forskrivning.no/files/b10d8941cd7046238ca775de7202c5f1",
      "WhenAddedToLedger": "2021-11-24T13:57:07.7269042+01:00",
      "WhenModified": "2021-11-24T13:57:10.2266578+01:00"
    },
    {
      "FileNameWithRelativePath": "Patients0\\0e7bfd89-ff43-4c5a-a9e2-1af46ae33672.pat",
      "FileName": "0e7bfd89-ff43-4c5a-a9e2-1af46ae33672.pat",
      "FileType": "patientFile",
      "Status": "completed",
      "RemoteUrl": "https://dataimport.test1.forskrivning.no/files/e8c90c2ae60147d899b4e9dfb3191573",
      "WhenAddedToLedger": "2021-11-24T13:57:07.7269042+01:00",
      "WhenModified": "2021-11-24T13:57:14.5703967+01:00"
    },
    /*...more entries....*/
],
  "ImportSession": "3dbc159d-1d6e-4a83-b5ad-2dad31f8bb40"
} 

Mirgration result

Successful upload doesn't guarantee successful import. SFM will handle the uploaded data asynchronously, and will generate a report when requested in SFM Datashare API.