Giter Site home page Giter Site logo

zdavatz / scan2post Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 419 KB

Scan a Swiss Health Insurance card and create a HTTP-Post request.

License: GNU General Public License v3.0

Objective-C 100.00%
krankenversicherung kartenleser macos post-request http card reader api web

scan2post's Introduction

Scan2Post

  • Use WebSockets with a Username to Push Information from the card to the server. No polling needed.
  • Scan a Swiss Health Insurance card and create a HTTP(S)-Post request.
  • Supported Scanner is PX-8935-919 from Xystec.
  • Download from the macOS Store.

Features

  1. Scan2Post has to be able to register in Start-Up Objects in the Settings.
  2. Scan2Post has to startup when the computer is started. Scan2Post has no Gui only a preferences field.
  3. If the User inserts a Swiss Insurance Card a HTTP-Post request is send to the URL according to the settings.
  4. In the settings field you have to able to set
  • HTTP(S) URL
  • Username
  • Password (optional)
  1. All the Data from the card in a JSON File. See sample below.
  2. Software has to be installed for the User.
  3. Software starts when the User logs in.
  4. The User has to be able to quit the application.
  5. When you run the application the first time then the User is asked: "Do you want to add Scan2Post to startup automatically at login?"
  6. If you click the Icon on the top bar, then you can close the Scan2Post application or access the settings, see 4.
  7. Deployment Target is 10.12.
  8. A Reference we used: WeatherBar
  9. Copy and Pasting via Mouse.

JSON HTTP(S) Post-Request File

{
"username":"[email protected]",
"password":"Password_that_is_optional",
"insuranceCard":{
"identificationData":{"firstName":"65.80.50","lastName":"65.80.50","birthDate":65.82.8,"sex":65.84.1,"ssn":"65.83.13"},
"administrationData":{"insurance":{"id":"65.92.5","name":"65.91.50"},"cardNumber":"65.93.20","expiryDate":65.94.8}
}}
  1. All dates set to UNIX timestamp and mmdd set to 0 (zero) and milliseconds also set to 0 (zero).
  2. Swiss Insurance Card Reference.
  3. HTTP Server useful for testing
  4. Password can be used for Server-Side Authentication.

Use Case

The User's Browser with the Web-Application is open. The User inserts a card into the card reader. Scan2Post sends all the information from the card as a HTTP-Post request to the defined URL in a JSON File. The data is then processed by the API/Server and the Web-App can refresh with the Data that was sent via the HTTP-Post-Request.

License

GPLv3.0 See License.

Contact

Zeno Davatz
ywesee GmbH
zdavatz at ywesee dot com
+41 43 540 05 50

Copyright

©ywesee GmbH, all rights reserved.

scan2post's People

Contributors

zdavatz avatar

Watchers

 avatar  avatar  avatar

scan2post's Issues

Add Support for Helsana Card

This is Java-Code:

Admin Data EFAD:

SELECT:

val isHelsana = channel.getCard.getATR.getBytes.length == 20
val data = Array[Byte](0x2F, 0x07)
val cmd = if (isHelsana) new CommandAPDU(0x0,0xA4, 0x2,0x0, data, 0x2) else  new CommandAPDU(0x0,0xA4, 0x0,0x0, data)
 

READ:

val expectedLength = if (isHelsana) 53 else 84
val cmd = new CommandAPDU(0,0xB0, 0,0,expectedLength)
val response = channel.transmit(cmd)

Parsing is the same like with the previous Standard.

Identification Data EFID:

SELECT:

val data = Array[Byte](0x2F, 0x6)
val cmd = if (isHelsana) new CommandAPDU(0x0,0xA4, 0x2,0x0, data, 0x2) else  new CommandAPDU(0x0,0xA4, 0x0,0x0, data)
 
READ:
val expectedLength = if (isHelsana) 59 else 84
val cmd = new CommandAPDU(0,0xB0, 0,0,expectedLength)

Parser:
val hexString         = data.map("%02X" format _).mkString
val indexBirthDate     = hexString.indexOf("8208")/2

val lengthName        = Integer.parseInt(hexString.substring(18,20),16)
val lastName          = new String(data,10, lengthName, "UTF-8")
val firstName         = new String(data,10 + lengthName + 6, indexBirthDate - lengthName - 16, "UTF-8")

val birthDate         = new String(data, indexBirthDate + 2, 8, "UTF-8")

val ssn               = new String(data,hexString.indexOf("830D")/2 + 2, 13 , "UTF-8")
val sex               = Integer.parseInt(hexString.substring(hexString.indexOf("8401") + 4,hexString.indexOf("8401") + 6),16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.