コード例 #1
0
 def healthServiceAvailability(code, priority, hospital, ssn, start_date=None):
     if start_date == None:
         start_date = DateConverter.fromDateToString(DateConverter.today())
     url = UrlProvider.raws['healthServiceAvailability']
     url = url.replace("[code]", code)
     url = url.replace("[priority]", priority)
     url = url.replace("[start_date]", start_date)
     url = url.replace("[hospital]", hospital)
     url = url.replace("[ssn]", ssn)
     url = url.replace("[hospital_description]", '-')
     return url
コード例 #2
0
if args.hospital:
    c = CUP()
    hospitals = c.getHospitals(args.servicecode, args.priority)

    for hospital in hospitals:
        print(hospital)

#python fastcup.py --book --servicecode P3039 --priority D --hospitalcode 30063 --ssn <AAABBB12X34Y567Z>
if args.book:
    c = CUP()
    services = c.getHospitalServices(args.servicecode, args.priority,
                                     args.hospitalcode, args.ssn)

    fl = FilterList(services)
    f = DateFilter()
    f.setGreaterThan(DateConverter.today())
    f.setSmallerThan(DateConverter.today() + DateConverter.delta(7))
    fl.addFilter(f)
    results = fl.getFiltered()

    for result in results:
        print(result)

#python fastcup.py --notify --servicecode P3039 --priority D --hospitalcode 30063 --ssn <AAABBB12X34Y567Z>
if args.notify:
    notify = Notify()
    qr = notify.register()

    secs = 120
    if args.seconds:
        secs = args.seconds