2022.10.5 更新
2022.10.5 更新
電子処方箋 導入記 (No.3)
確定処方箋XMLを作成する
前ページの逆の操作をすると 確定処方箋XMLが作成できます。
↓これが診療時に作成された処方箋CSVとしますと,
SJ1
1,1,1234567,13,支払基金病院
2,105-0004,東京都港区新橋2丁目1番1号 〇✕ビル3階
3,03-0000-0000,03-0000-0000,その他連絡先01
4,2,01,内科
-------(中略)-------
181,1,1,,用法補足情報01,,
201,1,1,1,2,621974801,ビクトーザ皮下注18mg 3mL,16.8,1,mg
211,1,1,101
221,1,1,1.25,1,,,,,,,,
231,1,1,0,0,0,0
241,1,1,1,1
281,1,1,1,,薬品補足情報01,
↓Base64 encodeします。
U0oxDQoxLDEsMTIzNDU2NywxMyzmlK/miZXln7rph5Hnl4XpmaINCjIsMTA1LTAwMDQs5p2x5Lqs6YO95riv5Yy65paw5qmL77yS5LiB55uu77yR55Wq77yR5Y+344CA44CH4pyV44OT44Or77yT6ZqODQozLDAzLTAwMDAtMDAwMCwwMy0wMDAwLTAwMDAs44Gd44Gu5LuW6YCj57Wh5YWI77yQ77yRDQo0LDIsMDEs5YaF56eRDQo1LDAwMDAwMDAwMDAwMDAwMSzvvbLvvbwgMDHvvpvvvbMs5Yy75bir44CA77yQ77yR6YOODQoxMSwwMDAwMDAwMDAwMDAwMDEs6Zu75Yem44CA5pyJ5Yq55Zub5YWrLO++g+++nu++ne+9vO+9riDvvpXvvbPvvbrvvbPvvpbvvp3vvorvvoENCjEyLDENCjEzLDE5NTAwNTAxDQoxNCwxDQoyMSwxDQoyMiwzMTQ4MDA0OA0KMjMsMjAyMiwxNjAwMTEsMSwwMQ0KMjQsMTAwLDEwMA0KMjUsMQ0KMjcsMjkxMjM0NTYsMTIzNDU2Nw0KMjgsMjkxMjM0NTYsMTIzNDU2Nw0KMjksMjkxMjM0NTYsMTIzNDU2Nw0KMzAsOTkxMjM0NTY3LTEyMzQ1Njc4OS0xMjM0NTY3ODktMTIzNDU2Nzg5MCw5OTEyMzQ1NjctMTIzNDU2Nzg5LTEyMzQ1Njc4OS0xMjM0NTY3ODkwDQozMSwxMTExDQo1MSwyMDIyMDcyMQ0KNTIsMjAyMjA4MTANCjYyLDENCjgxLDEsMSzlgpnogIPvvJDvvJENCjgyLDEsMTAwMDAwMDAwMDAwMDAwMQ0KMTAxLDEsNSwsMjgNCjExMSwxLDMsMzI3MTAwMDAwMDAwMDAwMCzvvJHml6XvvJHlm57jgIDnmq7kuIvms6jlsIQsMQ0KMTgxLDEsMSws55So5rOV6KOc6Laz5oOF5aCx77yQ77yRLCwNCjIwMSwxLDEsMSwyLDYyMTk3NDgwMSzjg5Pjgq/jg4jjg7zjgrbnmq7kuIvms6jvvJHvvJjvvY3vvYfjgIDvvJPvvY3vvKwsMTYuOCwxLG1nDQoyMTEsMSwxLDEwMQ0KMjIxLDEsMSwxLjI1LDEsLCwsLCwsLA0KMjMxLDEsMSwwLDAsMCwwDQoyNDEsMSwxLDEsMQ0KMjgxLDEsMSwxLCzolqzlk4Hoo5zotrPmg4XloLHvvJDvvJEsIA==
上記を, 前ページを参考に接頭語, 接尾語をくっつけて 処方箋XMLが出きました。↓
<?xml version='1.0' encoding='UTF-8'?>
<Document xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' id='Document' xsi:noNamespaceSchemaLocation='EP.xsd'>
<Prescription>
<PrescriptionManagement id='PrescriptionManagement'>
<Version Value='EPS1.0' />
</PrescriptionManagement>
<PrescriptionDocument id='PrescriptionDocument'>
U0oxDQoxLDEsMTIzNDU2NywxMyzmlK/miZXln7rph5Hnl4XpmaINCjIsMTA1LTAwMDQs5p2x5Lqs6YO95riv5Yy65paw5qmL77yS5LiB55uu77yR55Wq77yR5Y+344CA44CH4pyV44OT44Or77yT6ZqODQozLDAzLTAwMDAtMDAwMCwwMy0wMDAwLTAwMDAs44Gd44Gu5LuW6YCj57Wh5YWI77yQ77yRDQo0LDIsMDEs5YaF56eRDQo1LDAwMDAwMDAwMDAwMDAwMSzvvbLvvbwgMDHvvpvvvbMs5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d0NqSTFMREVLTWpjc01qa3hNak0wTlRZc01USXpORFUyTndveU9Dd3lPVEV5TXpRMU5pd3hNak0wTlRZM0NqSTVMREk1TVRJek5EVTJMREV5TXpRMU5qY0tNekFzT1RreE1qTTBOVFkzTFRFeU16UTFOamM0T1MweE1qTTBOVFkzT0RrdE1USXpORFUyTnpnNU1DdzVPVEV5TXpRMU5qY3RNVEl6TkRVMk56ZzVMVEV5TXpRMU5qYzRPUzB4TWpNME5UWTNPRGt3Q2pNeExERXhNVEVLTlRFc01qQXlNakEzTWpFS05USXNNakF5TWpBNE1UQUtOaklzTVFvNE1Td3hMREVzNVlLWjZJQ0Q3N3lRNzd5UkNqZ3lMREVzTVRBd01EQXdNREF3TURBd01EQXdNUW94TURFc01TdzFMQ3d5T0FveE1URXNNU3d6TERNeU56RXdNREF3TURBd01EQXdNREFzNzd5UjVwZWw3N3lSNVp1ZTQ0Q0E1NXF1NUxpTDVyT281YkNFTERFS01UZ3hMREVzTVN3czU1U281ck9WNktPYzZMYXo1b09GNWFDeDc3eVE3N3lSTEN3S01qQXhMREVzTVN3eExESXNOakl4T1RjME9EQXhMT09EaytPQ3IrT0RpT09Edk9PQ3R1ZWFydVM0aSthenFPKzhrZSs4bU8rOWplKzloK09BZ08rOGsrKzlqZSs4ckN3eE5pNDRMREVzYldjS01qRXhMREVzTVN3eE1ERUtNakl4TERFc01Td3hMakkxTERFc0xDd3NMQ3dzTEFveU16RXNNU3d4TERBc01Dd3dMREFLTWpReExERXNNU3d4TERFS01qZ3hMREVzTVN3eExDem9scXpsazRIb281em90clBtZzRYbG9MSHZ2SkR2dkpFc0NnPT08L1ByZXNjcmlwdGlvbkRvY3VtZW50PjwvUHJlc2NyaXB0aW9uPjwvRG9jdW1lbnQ+
これに医療機関コード, 任意テキスト<ArbitraryFileIdentifier>を付加して確定電子処方箋xmlが完成します。 ↓
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<XmlMsg>
<MessageHeader>
<MedicalInstitutionCode>1311234567</M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TVFveE15d3hPVFV3TURVd01Rb3hOQ3d4Q2pJeExERUtNaklzTXpFME9EQXdORGdLTWpNc01qQXlNaXd4TmpBd01URXNNU3d3TVFveU5Dd3hNREFzTVRBd0NqSTFMREVLTWpjc01qa3hNak0wTlRZc01USXpORFUyTndveU9Dd3lPVEV5TXpRMU5pd3hNak0wTlRZM0NqSTVMREk1TVRJek5EVTJMREV5TXpRMU5qY0tNekFzT1RreE1qTTBOVFkzTFRFeU16UTFOamM0T1MweE1qTTBOVFkzT0RrdE1USXpORFUyTnpnNU1DdzVPVEV5TXpRMU5qY3RNVEl6TkRVMk56ZzVMVEV5TXpRMU5qYzRPUzB4TWpNME5UWTNPRGt3Q2pNeExERXhNVEVLTlRFc01qQXlNakEzTWpFS05USXNNakF5TWpBNE1UQUtOaklzTVFvNE1Td3hMREVzNVlLWjZJQ0Q3N3lRNzd5UkNqZ3lMREVzTVRBd01EQXdNREF3TURBd01EQXdNUW94TURFc01TdzFMQ3d5T0FveE1URXNNU3d6TERNeU56RXdNREF3TURBd01EQXdNREFzNzd5UjVwZWw3N3lSNVp1ZTQ0Q0E1NXF1NUxpTDVyT281YkNFTERFS01UZ3hMREVzTVN3czU1U281ck9WNktPYzZMYXo1b09GNWFDeDc3eVE3N3lSTEN3S01qQXhMREVzTVN3eExESXNOakl4T1RjME9EQXhMT09EaytPQ3IrT0RpT09Edk9PQ3R1ZWFydVM0aSthenFPKzhrZSs4bU8rOWplKzloK09BZ08rOGsrKzlqZSs4ckN3eE5pNDRMREVzYldjS01qRXhMREVzTVN3eE1ERUtNakl4TERFc01Td3hMakkxTERFc0xDd3NMQ3dzTEFveU16RXNNU3d4TERBc01Dd3dMREFLTWpReExERXNNU3d4TERFS01qZ3hMREVzTVN3eExDem9scXpsazRIb281em90clBtZzRYbG9MSHZ2SkR2dkpFc0NnPT08L1ByZXNjcmlwdGlvbkRvY3VtZW50PjwvUHJlc2NyaXB0aW9uPjwvRG9jdW1lbnQ+
</PrescriptionInfo>
<IssueType>2</IssueType>
</MessageBody>
</XmlMsg>
これで確定処方箋XMLができあがりました。<IssueType>2 は 紙の処方箋であることを意味します。
前ページの最初の確定電子処方箋XMLの暗号部分とこのページの上の最終XMLの暗号部分はExact関数で調べてまったく同一であると判定できました。(メデタシ メデタシ (^_^))
ところで サンプルXMLではダブルコーテーション(“)が使われていますが, FilemakerのScriptの記載において, それは 支障が出るので, シングルコーテーションに変更してあります。オンライン資格確認導入期(Road9)参照
その変更はBase64変換に何の問題も無いようです。