Skip to content

Commit

Permalink
Merge pull request #181 from b123400/fix-179
Browse files Browse the repository at this point in the history
Send ePrescription to ZurRose
  • Loading branch information
zdavatz authored Dec 19, 2024
2 parents eaab9f7 + e9d6a49 commit 3e33015
Show file tree
Hide file tree
Showing 32 changed files with 7,040 additions and 38 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/archive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ jobs:
HIN_CLIENT_SECRET: ${{ secrets.HIN_CLIENT_SECRET }}
CERTIFACTION_SERVER: ${{ secrets.CERTIFACTION_SERVER }}
CERTIFACTION_TEST_SERVER: ${{ secrets.CERTIFACTION_TEST_SERVER }}
ZURROSE_CERTIFICATE_PASSWORD: ${{ secrets.ZURROSE_CERTIFICATE_PASSWORD }}
ZURROSE_CERTIFICATE: ${{ secrets.ZURROSE_CERTIFICATE }}
run: |
sed "s/YOUR_HIN_CLIENT_ID/$HIN_CLIENT_ID/;s/YOUR_HIN_CLIENT_SECRET/$HIN_CLIENT_SECRET/;s#YOUR_CERTIFACTION_SERVER#$CERTIFACTION_SERVER#;s#YOUR_CERTIFACTION_TEST_SERVER#$CERTIFACTION_TEST_SERVER#" ./AmiKoDesitin/HINClient/MLHINClientCredential.sample.h > ./AmiKoDesitin/HINClient/MLHINClientCredential.h
sed "s/XXXXXXX/$ZURROSE_CERTIFICATE_PASSWORD/" AmiKoDesitin/EPrescription/ZurRoseCredential.h.sample > ./AmiKoDesitin/EPrescription/ZurRoseCredential.h
echo $ZURROSE_CERTIFICATE | base64 --decode > AmiKoDesitin/EPrescription/client.p12
- name: Download databases
run: |
cd AmiKoDesitin
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ jobs:
HIN_CLIENT_SECRET: ${{ secrets.HIN_CLIENT_SECRET }}
CERTIFACTION_SERVER: ${{ secrets.CERTIFACTION_SERVER }}
CERTIFACTION_TEST_SERVER: ${{ secrets.CERTIFACTION_TEST_SERVER }}
ZURROSE_CERTIFICATE_PASSWORD: ${{ secrets.ZURROSE_CERTIFICATE_PASSWORD }}
ZURROSE_CERTIFICATE: ${{ secrets.ZURROSE_CERTIFICATE }}
run: |
sed "s/YOUR_HIN_CLIENT_ID/$HIN_CLIENT_ID/;s/YOUR_HIN_CLIENT_SECRET/$HIN_CLIENT_SECRET/;s#YOUR_CERTIFACTION_SERVER#$CERTIFACTION_SERVER#;s#YOUR_CERTIFACTION_TEST_SERVER#$CERTIFACTION_TEST_SERVER#" ./AmiKoDesitin/HINClient/MLHINClientCredential.sample.h > ./AmiKoDesitin/HINClient/MLHINClientCredential.h
sed "s/XXXXXXX/$ZURROSE_CERTIFICATE_PASSWORD/" AmiKoDesitin/EPrescription/ZurRoseCredential.h.sample > ./AmiKoDesitin/EPrescription/ZurRoseCredential.h
echo $ZURROSE_CERTIFICATE | base64 --decode > AmiKoDesitin/EPrescription/client.p12
- name: Download databases
run: |
cd AmiKoDesitin
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.DS_Store
__MACOSX/
*.xcscheme
*.p12
xcuserdata
AmiKoDesitin/amiko_report_de.html
AmiKoDesitin/amiko_report_fr.html
Expand All @@ -20,3 +21,4 @@ Podfile.lock
Pods/
tessdata/
AmiKoDesitin/HINClient/MLHINClientCredential.h
AmiKoDesitin/EPrescription/ZurRoseCredential.h
90 changes: 90 additions & 0 deletions AmiKoDesitin/EPrescription/EPrescription.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
//
// EPrescription.h
// Generika
//
// Created by b123400 on 2024/11/21.
// Copyright © 2024 ywesee GmbH. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ZurRosePrescription.h"

NS_ASSUME_NONNULL_BEGIN

@interface EPrescriptionPatientId : NSObject
@property (nonatomic, strong) NSNumber *type;
@property (nonatomic, strong) NSString *value;
@end

@interface EPrescriptionPField : NSObject
@property (nonatomic, strong) NSString *nm;
@property (nonatomic, strong) NSString *value;
@end

@interface EPrescriptionTakingTime : NSObject
@property (nonatomic, strong) NSNumber *off;
@property (nonatomic, strong) NSNumber *du;
@property (nonatomic, strong) NSNumber *doFrom;
@property (nonatomic, strong) NSNumber *doTo;
@property (nonatomic, strong) NSNumber *a;
@property (nonatomic, strong) NSNumber *ma;
@end

@interface EPrescriptionPosology : NSObject
@property (nonatomic, strong) NSDate *dtFrom;
@property (nonatomic, strong) NSDate *dtTo;
@property (nonatomic, strong) NSNumber *cyDu;
@property (nonatomic, strong) NSNumber *inRes;
@property (nonatomic, strong) NSArray<NSNumber*> *d;
@property (nonatomic, strong) NSArray<EPrescriptionTakingTime*> *tt;
@end

@interface EPrescriptionMedicament : NSObject
@property (nonatomic, strong) NSString *appInstr;
@property (nonatomic, strong) NSString *medicamentId;
@property (nonatomic, strong) NSNumber *idType;
@property (nonatomic, strong) NSString *unit;
@property (nonatomic, strong) NSNumber *rep;
@property (nonatomic, strong) NSNumber *nbPack;
@property (nonatomic, strong) NSNumber *subs;
@property (nonatomic, strong) NSArray<EPrescriptionPosology *> *pos;
@end

@interface EPrescription : NSObject

- (instancetype)initWithCHMED16A1String:(NSString *)str;

@property (nonatomic, strong) NSString *auth;
@property (nonatomic, strong) NSDate *date;
@property (nonatomic, strong) NSString *prescriptionId;
@property (nonatomic, strong) NSNumber * medType;
@property (nonatomic, strong) NSString *zsr;
@property (nonatomic, strong) NSArray<EPrescriptionPField *> *PFields;
@property (nonatomic, strong) NSString *rmk;
@property (nonatomic, strong) NSString *valBy; // The GLN of the healthcare professional who has validated the medication plan.
@property (nonatomic, strong) NSDate *valDt; // Date of validation

@property (nonatomic, strong) NSString *patientFirstName;
@property (nonatomic, strong) NSString *patientLastName;
@property (nonatomic, strong) NSDate *patientBirthdate;
@property (nonatomic, strong) NSNumber *patientGender;
@property (nonatomic, strong) NSString *patientStreet;
@property (nonatomic, strong) NSString *patientCity;
@property (nonatomic, strong) NSString *patientZip;
@property (nonatomic, strong) NSString *patientLang; // Patient’s language (ISO 639-19 language code) (e.g. de)
@property (nonatomic, strong) NSString *patientPhone;
@property (nonatomic, strong) NSString *patientEmail;
@property (nonatomic, strong) NSString *patientReceiverGLN;
@property (nonatomic, strong) NSArray<EPrescriptionPatientId *> *patientIds;
@property (nonatomic, strong) NSArray<EPrescriptionPField *> *patientPFields;

@property (nonatomic, strong) NSArray<EPrescriptionMedicament*> *medicaments;

// TODO: HcPerson, HcOrg

- (ZurRosePrescription *)toZurRosePrescription;
- (NSDictionary *)amkDict;

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit 3e33015

Please sign in to comment.