SFM migration report

The processing of the uploaded files is done asynchrounously. The results are updated into the database as the processing progresses. At any time it is possible to retreive a migration report from SFM to monitor the progress, and to handle any erronous elements.

The migration report may be accessed via SFM Datashare API usin a query function on the Basis resource (here from test):

https://datashare.test2.forskrivning.no/Basic?_query=MIGRATION_REPORT_01&date=ge2024-04-01&date=le2024-04-05

Additional parameter to adjust the amount of data returned patientLogLevel:

  • Information: Return Information, Warning and Error log entries relating to individual patients.
  • Warning : Return only Warning and Error log entries relating to individual patients, skip Information entries.
  • Error : Return only Error log entries relating to individual patients, skip Information and Warning entries.

The received report is a Base64 encoded data string, and may be encoded in a broad range of programs. The first part will contain a summary. New fields are added for number of unprocessed, and potentionally also unprocessed that has been put back into the unprocessed queue for retry.

An example of the start of a migration report retreived and decoded:

    {
            "SessionId": "c141e942-9d4a-4c69-b392-1b74d779f290",
            "SessionStart": "2022-04-11T10:53:53.6915401+02:00",
            "SessionEnd": "2022-04-11T10:54:01.9649241+02:00",
            "MigrationReportSummary": {
                "Organizations": {
                    "ImportedWithoutWarnings": 0,
                    "ImportedWithWarnings": 0,
                    "Failed": 0
                },
                "Patients": {
                    "ImportedWithoutWarnings": 3,
                    "ImportedWithWarnings": 0,
                    "Failed": 0
                },
                "Reports": {
                    "ImportedWithoutWarnings": 0,
                    "ImportedWithWarnings": 0,
                    "Failed": 0
                },
                "Unknowns": {
                    "ImportedWithoutWarnings": 0,
                    "ImportedWithWarnings": 0,
                    "Failed": 0
                }
            },
            "MigrationReportDetails": {
                "MigrationReportOrganizations": [],
                "MigrationReportPatients": [
                    {
                        "Id": "e37afe6f-af30-43f2-a5d6-1e4fe17af252",
                        "MigrationReportFileId": "2b49834b-59f4-4fb3-ba59-a8fa27806376",
                        "OperationType": "Create",
                        "Message": "Processing Element: Meldinger",
                        "TableName": null,
                        "KeyValues": null,
                        "OperationDateTime": "2022-04-11T10:53:54.8091534+02:00",
                        "LogLevel": "Information"
                    },
                    {
                        "Id": "3bae166b-0f05-4403-9409-657fd198a539",
                        "MigrationReportFileId": "2b49834b-59f4-4fb3-ba59-a8fa27806376",
                        "OperationType": "Create",
                        "Message": "Processing Element: Behandlinger",
                        "TableName": null,
                        "KeyValues": null,
                        "OperationDateTime": "2022-04-11T10:53:55.6207104+02:00",
                        "LogLevel": "Information"
                    },