zdavatz / amiko-osx

AmiKo Desitin for AmiKo OS X
https://apps.apple.com/ch/app/amiko-desitin/id708142753?mt=12
GNU General Public License v3.0
3 stars 2 forks source link

make sure to always validate the XML against the XSD before sending the XML. #213

Closed zdavatz closed 3 years ago

zdavatz commented 3 years ago
  1. This XML Document Zeno_Davatz_20.05.1975_16.01.02.08.2021.xml.txt
  2. still seems to create this error:
    ValidationException: The given document does not conform to the schema[medidata/definition/xsd/geninv-req-v45]. Error report[ValidationViolationBean{publicId=null, columnNumber=68, lineNumber=57, systemId=null, message=cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type 'stringType1_35'.}, ValidationViolationBean{publicId=null, columnNumber=68, lineNumber=57, systemId=null, message=cvc-type.3.1.3: The value '' of element 'invoice:companyname' is not valid.}, ValidationViolationBean{publicId=null, columnNumber=56, lineNumber=59, systemId=null, message=cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type 'stringType1_9'.}, ValidationViolationBean{publicId=null, columnNumber=56, lineNumber=59, systemId=null, message=cvc-complex-type.2.2: Element 'invoice:zip' must have no element [children], and the value must be valid.}, ValidationViolationBean{publicId=null, columnNumber=58, lineNumber=60, systemId=null, message=cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type 'stringType1_35'.}]
  3. We need to make sure to always validate the XML against the XSD before sending the XML.
  4. This worked for me xmllint --schema XML_Schema_generalInvoiceRequest_450/generalInvoiceRequest_450.xsd Zeno_Davatz_20.05.1975_16.01.02.08.2021.xml.txt --noout
  5. Bildschirmfoto 2021-08-02 um 17 11 10
  6. XSD is here: XML_Schema_generalInvoiceRequest_450.zip
zdavatz commented 3 years ago
  1. With the GLN 2099988876514 the following fields are left empty:
  2.             <invoice:insurance ean_party="2099988876514">
                    <company>
                        <invoice:companyname></invoice:companyname>
                        <invoice:postal>
                            <invoice:zip></invoice:zip>
                            <invoice:city></invoice:city>
                        </invoice:postal>
  3. If an address for a GLN is not found in https://github.com/zdavatz/amiko-osx/blob/master/AmiKoOSX/participants-kvg.json then lets skip the Tags invoice:companyname, invoice:zip, invoice:city.
zdavatz commented 3 years ago

I will just update https://github.com/zdavatz/amiko-osx/blob/master/AmiKoOSX/participants-kvg.json with the test GLN.

zdavatz commented 3 years ago

nach obigem Commit kriege ich jetzt noch diesen Error:

2021-08-02 17:23:38.330363+0300 AmiKo Desitin[2883:65440] Memory in use (in bytes): 215605248
2021-08-02 17:23:40.392641+0300 AmiKo Desitin[2883:65440] Patient findParticipantsKvg '01111'
2021-08-02 17:23:40.395020+0300 AmiKo Desitin[2883:65440] [General] *** -[__NSCFString substringToIndex:]: Index 35 out of bounds; string length 18
2021-08-02 17:23:40.396849+0300 AmiKo Desitin[2883:65440] [General] (
    0   CoreFoundation                      0x00007fff2071a87b __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007fff20452d92 objc_exception_throw + 48
    2   Foundation                          0x00007fff213fbdca -[NSString substringToIndex:] + 174
    3   AmiKo Desitin                       0x00000001026ae447 +[MedidataXMLGenerator xmlInvoiceInsuranceWithPatient:] + 599
    4   AmiKo Desitin                       0x00000001026b0997 +[MedidataXMLGenerator xmlInvoiceRequestWithOperator:patient:prescriptionItems:] + 5479
    5   AmiKo Desitin                       0x00000001026b2065 +[MedidataXMLGenerator xmlInvoiceRequestDocumentWithOperator:patient:prescriptionItems:] + 149
    6   AmiKo Desitin                       0x0000000102658643 -[MLMainWindowController onSendPrescriptionToMedidata:] + 323
    7   AppKit                              0x00007fff230c070b -[NSApplication(NSResponder) sendAction:to:from:] + 288
    8   AppKit                              0x00007fff230c05af -[NSControl sendAction:to:] + 86
    9   AppKit                              0x00007fff230c04e1 __26-[NSCell _sendActionFrom:]_block_invoke + 131
    10  AppKit                              0x00007fff230c03e8 -[NSCell _sendActionFrom:] + 171
    11  AppKit                              0x00007fff230c032e -[NSButtonCell _sendActionFrom:] + 96
    12  AppKit                              0x00007fff230bd417 NSControlTrackMouse + 1820
    13  AppKit                              0x00007fff230bccd3 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 130
    14  AppKit                              0x00007fff230bcb9a -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 697
    15  AppKit                              0x00007fff230bbec2 -[NSControl mouseDown:] + 722
    16  AppKit                              0x00007fff230ba2ae -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4961
    17  AppKit                              0x00007fff23029a98 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2594
    18  AppKit                              0x00007fff23028e56 -[NSWindow(NSEventRouting) sendEvent:] + 347
    19  AppKit                              0x00007fff23027264 -[NSApplication(NSEvent) sendEvent:] + 352
    20  AppKit                              0x00007fff233005fd -[NSApplication _handleEvent:] + 65
    21  AppKit                              0x00007fff22e9025e -[NSApplication run] + 623
    22  AppKit                              0x00007fff22e6447c NSApplicationMain + 816
    23  AmiKo Desitin                       0x00000001026468a2 main + 34
    24  libdyld.dylib                       0x00007fff205c2f5d start + 1
    25  ???                                 0x0000000000000003 0x0 + 3
)