I am using https://fleet.ls.hereapi.com/2/calculateroute.json to calculate a route in Norway including toll costs. This is working. However, there is a toll pass in Norway, AutoPASS, and I can't get the calculation to use this parameter.
I have tried:
...&tollpass=AutoPASS
...&tollpass=Annual,AutoPASS,EasyGO
...&tollpass=Senior_Pass,transponder,Annual,Nr_of_Days,Nr_of_Months,SunPass,E-Z Pass,AutoPASS,EasyGo
I get 91 EUR, or 88 EUR when transponder is set in tollpass.
Using this: https://www.fjellinjen.no/privat/bompengekalkulator/ I can see that without a toll pass the fee is 962 NOK which equals 91 EUR. With the toll pass the fee equals 446 NOK which equals 42 EUR.
How do you get the toll cost using the Norwegian AutoPASS?
I have removed my API key from the following link:
https://fleet.ls.hereapi.com/2/calculateroute.json?waypoint0=59.08597,11.24958&waypoint1=59.94091,10.97901&waypoint2=59.08597,11.24958&rollups=none,country;tollsys&mode=fastest;truck;traffic:disabled&length=17m&commercial=1&limitedWeight=40t&height=4m¤cy=EUR&tollVehicleType=3&trailerType=2&trailersCount=1&vehicleNumberAxles=3&trailerNumberAxles=2&tollPass=AutoPASS
Below request is working with tollPass=AutoPass, we are getting 44.92 EUR:
https://fleet.ls.hereapi.com/2/calculateroute.json?waypoint0=59.08597,11.24958&waypoint1=59.94091,10.97901&waypoint2=59.08597,11.24958&rollups=none,country;tollsys&mode=fastest;truck;traffic:disabled&length=17m&commercial=1&limitedWeight=40t&height=4m¤cy=EUR&tollVehicleType=3&trailerType=2&trailersCount=1&vehicleNumberAxles=3&trailerNumberAxles=2&tollPass=AutoPass
Related
Specific Question
I parsed C-CDA with BlueButton.js. Following is from the Medication JSON output. What is the RXNorm (with code system "2.16.840.1.113883.6.88") in this example? It has 577961 and 577962. Which is the correct RxNorm for the patient's medication?
"product": {
"name": "Amphetamine aspartate 5 MG / Amphetamine Sulfate 5 MG / Dextroamphetamine saccharate 5 MG / Dextroamphetamine Sulfate 5 MG Oral Tablet",
"text": "Adderall 20 mg tablet",
"code": "577961",
"code_system": "2.16.840.1.113883.6.88",
"translation": {
"name": "Amphetamine aspartate 5 MG / Amphetamine Sulfate 5 MG / Dextroamphetamine saccharate 5 MG / Dextroamphetamine Sulfate 5 MG Oral Tablet [Adderall]",
"code": "577962",
"code_system": "2.16.840.1.113883.6.88",
"code_system_name": "RxNorm"
}
}
General Question
Where can I get explnanation of these C-CDA elements - that is, the difference between code element in product and translation elements?
References:
HL7-Referenced External Code Systems
So RxNorm is a terminology that used in the United States for recording and transmitting medication information. It's a complex terminology/ontology since it allows for ingredients, coordinated dose forms, brand names, generic names and a bunch more. You can browse RxNorm here online without any login:
https://mor.nlm.nih.gov/RxNav/
(they also have an API that you use, but that should get you started)
Specifically on the drugs you mentioned: 577961 is the generic format and 577962 is the brand of the same drug. According to the standard, either of those codes are technically correct since they are SCD and SBD term types respectively (Semantic Clinical/Brand Drug) I don't know if it's 100% clear whether the patient is on the brand or generic given that both codes are transmitted. There may be other information in the document regarding (such as what drug was dispensed).
In terms of learning about the standard, which is HL7 C-CDA, you could download the standard here, although this requires a free HL7 login: http://www.hl7.org/implement/standards/product_brief.cfm?product_id=492
HL7 is the standards development organization (SDO) for medical data standards. They also offer a lot of educational content on their standards. I hope this helps!
Using this example https://developer.here.com/documentation/toll-cost/topics/example-tollcost.html
and description from here https://developer.here.com/documentation/toll-cost/topics/resource-tollcost-input-interface.html trying to calculate tolls on usa roads
First found paid road to be sure to have it on the route - found here https://www.sixt.com/toll-roads/usa/ - rout in Florida from Punta Gorda, FL, United States to Islamorada, FL, United States
From route received two links
0: {linkId: "-91500228", mappedPosition: {latitude: 26.9336687, longitude: -82.0531188},…}
1: {linkId: "+897488196", mappedPosition: {latitude: 24.9598652, longitude: -80.5699824},…}
Then do tolls request
https://tce.api.here.com/2/tollcost.json
?app_id=my_app_id
&app_code=my_code
&tollVehicleType=3
&vehicleNumberAxles=2
&emissionType=6
&height=3.5m
&vehicleWeight=10.0t
&limitedWeight=10.0t
&passengersCount=1
&tiresCount=8
&route=-91500228;897488196
&detail=1
In response always receive:
{"errors":[],"warnings":[{"category":1,"context":"Old response format is deprecated, please use request parameter &rollup"}],"countries":[],"onError":false}
Tried different locations in usa, no matter what - always empty countries array
Please advice what I'm missing, thank you
Here is a working example:
https://tce.cit.api.here.com/2/calculateroute.json?jsonAttributes=41&waypoint0=26.13442,-81.68696&detail=1&waypoint1=26.08104,-80.36682&routelegattributes=li&routeattributes=gr&maneuverattributes=none&linkattributes=none,rt,fl&legattributes=none,li,sm¤cy=EUR&departure=&tollVehicleType=3&emissionType=5&height=3.8m&vehicleWeight=11000&limitedWeight=11t&passengersCount=1&tiresCount=4&commercial=1&heightAbove1stAxle=1m&width=2.55&length=10&mode=fastest;truck;traffic:enabled&rollup=none,country;tollsys&app_id=yyy&app_code=xxx
In general is the parameter rollup missing in your request. This one need to be added in any case. Besides of that is the route you try to calculate quite far over islands with a truck with a specific size and weight. It is quite difficult to get an idea within the pure HTTPRest request. Maybe this demo page helps a bit for debugging such cases:
https://tcs.ext.here.com/examples/v3/route_with_tce
In the documentation I see:
vehicleWeight -- Number. Actual total weight of vehicle incl. its payload but NOT the trailers' weight or payload.
For me the truck itself is 12t. While trying to get costs for toll roads with this value, I'm getting distance 470km, costs 58Eur and it is wrong.
So, I want to know what is the problem: 1) documentation error, vehicleWeight should be mass truck+trailer, 2) I missed some extra parameters, 3) or maybe some other issue?
When I tryied to change vehicleWeight from 12t to 20t (truck+trailer mass) the result is correct, about 85Eur.
https://tce.cit.api.here.com/2/calculateroute.json?app_id={app_id}&app_code={app_code}&tollVehicleType=3&trailerType=2&trailersCount=1&vehicleNumberAxles=2&trailerNumberAxles=2&emissionType=6&height=4.0m&trailerHeight=4.0m&vehicleWeight=12t&limitedWeight=20t&tiresCount=10&commercial=1&cost_optimize=0&driver_cost=0.0&vehicle_cost=0.0¤cy=EUR&rollup=country;tollsys&waypoint0=geo!stopOver!49.4889567,10.978884&waypoint1=geo!passThrough!50.1211273,8.4961394&waypoint2=geo!stopOver!51.2383707,6.6739259&mode=fastest;truck;traffic:disabled&vehicleType=diesel,28
I expect to get here about 85Eur (because distance is about 470km and price for Euro 6, >18t, 4 axles is 0.187cents/km), but actually API returning about 58Eur.
Thank you for reporting this issue. It seems that there was an issue and we could solve it already. Within the next release planned for February this will be solved.
An address containing a "#" (for example an apartment number) frequently gives an incorrect location result, both with ggmap::geocode and with google maps as well, so this is not strictly an R question. In this example, adding a "#3" after the street address changes the location result from Illinois to California:
> test <- geocode('1200 Davis St, Evanston, IL 60202', source='google', output='more')
> test[, c('lon', 'lat', 'administrative_area_level_1')]
lon lat administrative_area_level_1
1 -87.68978 42.04627 Illinois
> testhash <- geocode('1200 Davis St #3, Evanston, IL 60202', source='google', output='more')
> testhash[, c('lon', 'lat', 'administrative_area_level_1')]
lon lat administrative_area_level_1
1 -122.1692 37.72169 California
If you experiment with google maps directly, sometimes adding a hash into an address seems to confuse the lookup, generating a variety of geographically dispersed results. This doesn't always happen, but in my experience happens frequently. It's easily fixed (there's no need for an apartment number when geocoding) but I'm wondering why it happens and if there are other cautions about entering addresses.
Google has recommendations in regard to address formatting in Geocoding API. Particularly they suggest do not specify additional elements like apartment number or floor numbers in requests.
You can check the complete list of recommendations in Google Maps FAQ:
https://developers.google.com/maps/faq#geocoder_queryformat
The relevant part is
Do not specify additional address elements such as business names, unit numbers, floor numbers, or suite numbers that are not included in the address as defined by the postal service of the country concerned. Doing so may result in responses with ZERO_RESULTS.
I hope this helps!
Before you say that this has already been asked, know that I've already reviewed these:
Is there a standard for storing normalized phone numbers in a database? - This is from 2008, and says that, at the time, there was no such standard. I'm hoping that something changed in the last 13 years.
How to validate phone numbers using regex - I already have the parse; it's quite easy: If it's not a digit, skip it. This question is not about the parser, but the format in which I save/display it. I am not worried about how hard it is to parse, but whether it's in standard format.
Say I'm working on a program that has to deal with phone numbers, and I want to make sure that they're saved and displayed in a standard format, so other programs and humans can also understand them predictably & consistently.
For instance, I've seen the following all be valid representations for the same US phone number:
1234567
123-4567
123 4567
5551234567
(555) 1234567
555-1234567
555 123 4567
555-123-4567
(555)-123-4567
(555) 123-4567
(5) 123 4567
1-555-123-4567
(1) 555-123-4567
+1 555-123-4567
+1 555 123-4567
+1 (555) 123-4567
Ad nauseum…
And then different countries represent numbers in different ways:
55 1234 567 8901
55 12 3456 7890
55 123 456 7890
55 1234 567890
555 123 456
(55) 123 4567
5.555.123-45-67
Ad nauseum…
As you can see, the number of ways a user can see a valid phone number is nearly infinite (The Wikipedia page for Telephone numbers in the UK is 26 printer pages long). I want all the numbers in my database and on the screen to be in a universally-recognizable format. As far as I can tell, ISO and ANSI have no defined format. Is there any standard notation for phone numbers?
There's no ISO standard, but there are ITU standards. You want E.123 and E.164.
In summary, any phone number is represented by +CC MMMMMM... where CC is the country code, and is one to three digits, and MMMMMM... is the area code (where applicable) and subscriber number. The total number of digits may not be more than 15. The + means "your local international dialling prefix".
I'll give a few examples using my own land line number.
So, for example, if you are in Germany, the number +44 2087712924 would be dialled as 00442087712924, and in the US you would dial it as 011442087712924. The 44 means that it is a UK number, and 2087712924 is the local part.
In practice, the long string of MMMMM... is normally broken up into smaller parts to make it easier to read. How you do that is country-specific. The example I give would normally be written +44 20 8771 2924.
As well as the unambiguous E.123 representation above, which you can use from anywhere in the world that allows international dialling, each country also has its own local method of representing numbers, and some have several. The example number will sometimes be written as 020 8771 2924 or (020) 8771 2924. The leading 0 is, strictly speaking, not part of the area code (that's 20) but a signal to the exchange meaning "here comes a number that could go outside the local area". Very occasionally the area code will be ommitted and the number will be written 8771 2924. All these local representations are ambiguous, as they could represent valid numbers in more than one country, or even valid numbers in more than one part of the same country. This means that you should always store a number with its country code, and ideally store it in E.123 notation. In particular you should note that phone numbers ARE NOT NUMBERS. A number like 05 is the same as 5. A phone number 05 is not the same as 5, and storage systems will strip leading zeroes from numbers. Store phone numbers as CHAR or VARCHAR in your database.
Finally, some oddities. The example number will be written by some stupid people as 0208 771 2924. This is diallable, but if you strip off the leading 0208 assuming that it is an area code, then the remainder is not valid as a local number. And some countries with broken phone systems [glares at North America] have utterly bonkers systems where in some places you must dial all 10 digits for a local call, some where you must not, some where you must dial 1NNN NNN NNNN, some where you must not include the leading one, and so on. In all such cases, storing the number as +CC MMMMM... is correct. It is up to someone actually making a call (or their dialling software) to figure out how to translate that into a dialable sequence of digits for their particular location.
There is a lot of local countries standards. On one of my projects I had the same problem. Solved as:
In DB everything stored as numbers: 123456789
Depending on selected web page language, this number pre-formatted when page loads.
Examples:
France, Luxemburg format phone numbers like 12.34.56.78.90 or 12 34
56 78 90
Germany: 123 45 67 or 123-45-67
Great Britain: 020 1234 1234 or 1234 01234 12345
Italy, Netherlands: 12 1234567 or 020-1234567
CIS countries: 123 123-45-67