SIU23 block off time - hl7

Where I can found Block start date-time and end date-time in SIU23 message.
(The block time is the time which restrict the appointment creation in that time)

Note that the semantics of a HL7 message must be defined by the sending/consuming systems (HL7 mainly defines the syntax of the messages).
You are probably looking for the TQ1-7 (Start date/time) and TQ1-8 (End date/time) fields of the SIU message. But you should double check with the documentation of the sending system.
SIU messages definition

Related

Need to capture and respond to utterance not in slot

Hello StackOverflow Friends:
Slots 1-5 below work great.
The problem is now I have to ask the user (after slot 5) "Describe the bug you encountered".
I suspect it is to broad / vague to put into a slot. I.e. if they say "the video crashed" and not "the player stopped" it keeps asking them to, "Describe the bug you encountered".
How do I respond with a "thank you" after the user types in, in their own words, the bug they encountered?
As per this documentation: https://docs.aws.amazon.com/lex/latest/dg/howitworks-builtins-slots.html, there are no built-in slot types that can support free-form text/speech
As a workaround, you could create a slot of any type (e.g. AMAZON.NUMBER or AMAZON.Alphanumeric) so that you can use it to ask the 6th question for bug description. In addition, implement a code-hook lambda function for your intent.
At the end after 1-5 slots are filled, when this dummy slot is elicited with the required question, it will always turn up empty, however in the input event received by the code-hook lambda function- you can find the inputTranscript- this will capture what the caller has provided as input, even if the dummy slot value comes up as empty.
In your lambda function, you may ignore empty value of slot and go ahead with closing the Bot, by sending response as 'Fulfilled' after 1-5 are filled and you are received a non-empty value of inputTranscript for the 6th question.
Alternatively, you may return ElicitIntent (rather than ElicitSlot) from the code-hook lambda after slots 1-5 are filled. In this case you will not need to create a dummy slot as we are not using ElicitSlot. You will need to create a Fallback Intent and associate it with the lambda code-hook so that input transcript can be captured and saved as what the caller says may not match with utterances required for your original intent.
For more details on lambda code-hook for lex-intents, refer:
https://docs.aws.amazon.com/lex/latest/dg/programming-model.html#prog-model-lambda
https://docs.aws.amazon.com/lex/latest/dg/lambda-input-response-format.html

IBM COGNOS incompatible data types in CASE / IF expression

I have been trying for hours to get , what I thought to be, a simple if-then-else statement to work in IBM Cognos / Report Studio 10.0.
I am simply trying to create a data item in a query, to decide which day of the week a date is, and then return a calculated date.
if (cast(_day_of_week([Expected Delivery Date],1), integer) = 1)
then (_add_days([Expected Delivery Date],2))
else (current_date)
The back end database is Informix. I am receiving the error "Corresponding data types must be compatible in CASE expression or DECODE".
I have tried every variant I can think of: with/without cast, using case/when/then. I have created a separate data item also:
[Calc Day of Week] (Data Item - calculates correctly)
cast(_day_of_week([Expected Delivery Date],1), integer)
[Calc Exp Despatch Date] (Data Item)
if ([Calc Day of Week] = 1)
then (_add_days([Expected Delivery Date],2))
else (current_date)
Even when using that data item in my next data item, I get the same error.
I can only think that it doesn't understand that I am basing the comparison on an integer and attempting to return a date - but if that is the case, how do I create a data item to perform such a calculation?
Any help is greatly appreciated.
The error is saying that the data types of the THEN and ELSE parts are different. Your first step is to determine the data types. You don't mention if you have done that with the calculations that you mention. They seem to be concentrating on the IF part of the function.
The basic technique is called divide and conquer. A more elegant wording is, controlling the variables or isolating the components.
_day_of_week returns an int so I don't know why you are doing the casting. (_day_of_week([Expected Delivery Date] = 1 ) should be sufficient but that's for later.
Take _add_days([Expected Delivery Date],2). Put it into an expression and find out the data type which is returned.
Compare that data type with current_date.
Current_date returns a date. What is the data type of expected delivery date? date or datetime?
If the data types are different then your approach would be to modify one or the other to match the other. For example, cast _add_days([Expected Delivery Date],2) to date if it is a date time. Or use current_timestamp but I don't use it so I can't speak much about it.
If you use 1=1 and 1<>1 in place of what you have for your if part then you can control the flow of the expression and verify that the error is coming from the then and else bits.
Here's something, for another application, but valid in outlining testing techniques.
https://www.ibm.com/support/pages/corresponding-types-must-be-compatible-case-expression

Mirth : Need clarification on the usage of segments in message types

This question is on HL7, my understanding is that any segment(sch, pv1 etc) in HL7 is independent of message type(ADT, SIU etc), that means any type of message can contain any type of segment and there are no restrictions that a particular type of message type can have only certain segments and not any segment, am I correct?
Hope my question is clear...
Not exactly. HL7 has many segments and trigger events, each having a specific purpose and action. Out of that whole lot, when someone is designing a healthcare interfacing application, they have to choose the right segments and trigger events. That is called cardinality which requires a definition of:
Mandatory segments (MSH,PID,PV1 etc)
Optional Segments (DG1,PR1,AL1 etc)
Repeating Segments (OBX)
Once cardinality is defined, then the message starts taking its shape.
A patient demographics trigger event shall include MSH, EVN, PID, PV1, IN1, GT1. But not necessarily DG1, PR1 and AL1.
Similarly, a charge message should definitely include FT1 (financial transactions) segment in the message. An order message should definitely include OBR and ORC segments.
Each segment in HL7 has a defined purpose. There isn't any point in including FT1 in demographics message or an OBR in an SIU message (just an example).
What an application can or cannot send out is called specification of that application.
It is required to understand message cardinality. One cannot create an HL7 message on the fly. It is neither technically feasible nor logically correct.
There is one more segment type called “Z” segment which carries the user defined information and is not defined by HL7. For example, ZDS contains additional ID for the imaging study. The number and coding of Z segments are also user defined.
In order to process such segments both sending and receiving applications must agree on the format, which potentially leads to errors.

timeZone in checkin

Looking at the docs there is a descrepancy between the data in a checkin object for the query API s the push API with regards to timeZone.
According to https://developer.foursquare.com/overview/realtime a sample push will contain the name of the tz eg America/New_York
However according to https://developer.foursquare.com/docs/responses/checkin (and the API explorer) a checkin object will contain the timeZone offset eg 60 for GMT+1
I havn't managed to confirm whats in the Push API myself yet as I hav to setup the SSL certs, can anyone confirm of the docs are correct and we do indeed have 2 type of tz format. I would have thought that including the timeZone rather than the offset would be better as this doesn't vary with Daylight Savings unlike the figure. Europe/London will always be a constant where as the offset will switch between 0 and 60 mins
I'm not directly familiar with FourSquare's API, so I can't confirm or deny this for you. But I can tell you there are often cases where you would use both.
It is ok to only present an offset, if the data represents a particular time. Since the checkin response provides a createdAt date/time as an integer seconds since epoch (aka a "Unix Timestamp"), then it is appropriate to provide a separate offset. (Although I find it interesting that they provide the offset as a string and not as an integer number of minutes.) The other way you might do this would be with a single DateTimeOffset values, usually presented in ISO8601 format, as in 2013-06-02T01:23:45-07:00. Either are acceptable.
But as you may be aware, an offset does not uniquely identify a time zone. In the case of a single event, it doesn't need to. But if it were a recurring event, or if there was a possibility that you might want to modify the time value, then an offset alone would not suffice. That's when you need the full zone identifier.
If you have a zone identifier such as America/New_York, then you can always find out what the correct offset for any date/time would be. But not everyone has a TZDB implementation readily available. For example, in .Net on Windows, you get Microsoft's clumsy time zone database by default, and you have to find a library (like NodaTime) if you want to use the TZDB zones.
It does seem strange that the push and pull for the same type of action (a check-in) would have different values just because they were going through different APIs. My advice (to Foursquare) would be threefold:
Be consistent about the data for the same activity, regardless of push vs pull.
Provide both the TZDB identifier, and the the UTC offset associated with the event.
Provide the event's timestamp and offset in a single value, as an ISO8601 formatted string, rather than a unix time integer.
The Foursquare documentation is correct but a bit incomplete (as of time of posting). The check-in response contains a timeZoneOffset field. The real-time push response has a timeZone field and a timeZoneOffset field—the timeZone field is still there for legacy purposes.
Thanks for pointing this out; we'll update the docs to reflect that timeZoneOffset is the preferred method at this point. As Matt mentioned, the offset method is a better way to identify a particular time from createdAt.

Getting the time of the received message

How does one get the time of the received message in Erlang?
I want to calculate something according to the frequency of the received messages to the gen_server.
e.g. message 1, some time, message 2 some time.
get the time between messages.
Thanks
You can use statistics(wall_clock) each time you receive a message.
The second member of the tuple it returns will be the time between the two receives (in milliseconds).
Edit:
As rvirding mentions in his comment, you can also use now() and then calculate the time difference accordingly. Take a look at supervisor.erl found in the $ERL_TOP/lib/stdlib/src/ directory of your Erlang/OTP distribution. The last lines of that module (functions addRestart, inPeriod and difference) calculate the frequency of restarts using now().

Resources