In Elixir and many functional languages, functions are first class citizens. We will learn about the types of functions in Elixir, what makes them different, and how to use them.
Table of Contents
Anonymous Functions
Just as the name implies, an anonymous function has no name.
As we saw in the Enum
lesson, these are frequently passed to other functions.
To define an anonymous function in Elixir we need the fn
and end
keywords.
Within these we can define any number of parameters and function bodies separated by ->
.
Let’s look at a basic example:
iex> sum = fn (a, b) -> a + b end
iex> sum.(2, 3)
5
The & Shorthand
Using anonymous functions is such a common practice in Elixir there is shorthand for doing so:
iex> sum = &(&1 + &2)
iex> sum.(2, 3)
5
As you probably already guessed, in the shorthand version our parameters are available to us as &1
, &2
, &3
, and so on.
Pattern Matching
Pattern matching isn’t limited to just variables in Elixir, it can be applied to function signatures as we will see in this section.
Elixir uses pattern matching to check through all possible match options and select the first matching option to run:
iex> handle_result = fn
...> {:ok, result} -> IO.puts "Handling result..."
...> {:ok, _} -> IO.puts "This would be never run as previous will be matched beforehand."
...> {:error} -> IO.puts "An error has occurred!"
...> end
iex> some_result = 1
iex> handle_result.({:ok, some_result})
Handling result...
iex> handle_result.({:error})
An error has occurred!
Named Functions
We can define functions with names so we can easily refer to them later.
Named functions are defined within a module using the def
keyword .
We’ll learn more about Modules in the next lessons, for now we’ll focus on the named functions alone.
Functions defined within a module are available to other modules for use. This is a particularly useful building block in Elixir:
defmodule Greeter do
def hello(name) do
"Hello, " <> name
end
end
iex> Greeter.hello("Sean")
"Hello, Sean"
If our function body only spans one line, we can shorten it further with do:
:
defmodule Greeter do
def hello(name), do: "Hello, " <> name
end
Armed with our knowledge of pattern matching, let’s explore recursion using named functions:
defmodule Length do
def of([]), do: 0
def of([_ | tail]), do: 1 + of(tail)
end
iex> Length.of []
0
iex> Length.of [1, 2, 3]
3
Function Naming and Arity
We mentioned earlier that functions are named by the combination of given name and arity (number of arguments). This means you can do things like this:
defmodule Greeter2 do
def hello(), do: "Hello, anonymous person!" # hello/0
def hello(name), do: "Hello, " <> name # hello/1
def hello(name1, name2), do: "Hello, #{name1} and #{name2}"
# hello/2
end
iex> Greeter2.hello()
"Hello, anonymous person!"
iex> Greeter2.hello("Fred")
"Hello, Fred"
iex> Greeter2.hello("Fred", "Jane")
"Hello, Fred and Jane"
We’ve listed the function names in comments above.
The first implementation takes no arguments, so it is known as hello/0
; the second takes one argument so it is known as hello/1
, and so on.
Unlike function overloads in some other languages, these are thought of as different functions from each other.
(Pattern matching, described just a moment ago, applies only when multiple definitions are provided for function definitions with the same number of arguments.)
Functions and Pattern Matching
Behind the scenes, functions are pattern-matching the arguments that they’re called with.
Say we needed a function to accept a map but we’re only interested in using a particular key. We can pattern-match the argument on the presence of that key like this:
defmodule Greeter1 do
def hello(%{name: person_name}) do
IO.puts "Hello, " <> person_name
end
end
Now let’s say we have a map describing a person named Fred:
iex> fred = %{
...> name: "Fred",
...> age: "95",
...> favorite_color: "Taupe"
...> }
These are the results we’ll get when we call Greeter1.hello/1
with the fred
map:
# call with entire map
...> Greeter1.hello(fred)
"Hello, Fred"
What happens when we call the function with a map that doesn’t contain the :name
key?
# call without the key we need returns an error
...> Greeter1.hello(%{age: "95", favorite_color: "Taupe"})
** (FunctionClauseError) no function clause matching in Greeter1.hello/1
The following arguments were given to Greeter1.hello/1:
# 1
%{age: "95", favorite_color: "Taupe"}
iex:12: Greeter1.hello/1
The reason for this behavior is that Elixir pattern-matches the arguments that a function is called with against the arity the function is defined with.
Let’s think about how the data looks when it arrives to Greeter1.hello/1
:
# incoming map
iex> fred = %{
...> name: "Fred",
...> age: "95",
...> favorite_color: "Taupe"
...> }
Greeter1.hello/1
expects an argument like this:
%{name: person_name}
In Greeter1.hello/1
, the map we pass (fred
) is evaluated against our argument (%{name: person_name}
):
%{name: person_name} = %{name: "Fred", age: "95", favorite_color: "Taupe"}
It finds that there is a key that corresponds to name
in the incoming map.
We have a match! And as a result of this successful match, the value of the :name
key in the map on the right (i.e. the fred
map) is bound to the variable on the left (person_name
).
Now, what if we still wanted to assign Fred’s name to person_name
but we ALSO want to retain awareness of the entire person map? Let’s say we want to IO.inspect(fred)
after we greet him.
At this point, because we only pattern-matched the :name
key of our map, thus only binding the value of that key to a variable, the function doesn’t have knowledge of the rest of Fred.
In order to retain it, we need to assign that entire map to its own variable for us to be able to use it.
Let’s start a new function:
defmodule Greeter2 do
def hello(%{name: person_name} = person) do
IO.puts "Hello, " <> person_name
IO.inspect person
end
end
Remember that Elixir will pattern match the argument as it comes in. Therefore in this case, each side will pattern match against the incoming argument and bind to whatever it matches with. Let’s take the right side first:
person = %{name: "Fred", age: "95", favorite_color: "Taupe"}
Now, person
has been evaluated and bound to the entire fred-map.
We move on to the next pattern-match:
%{name: person_name} = %{name: "Fred", age: "95", favorite_color: "Taupe"}
Now this is the same as our original Greeter1
function where we pattern matched the map and only retained Fred’s name.
What we’ve achieved is two variables we can use instead of one:
person
, referring to%{name: "Fred", age: "95", favorite_color: "Taupe"}
person_name
, referring to"Fred"
So now when we call Greeter2.hello/1
, we can use all of Fred’s information:
# call with entire person
...> Greeter2.hello(fred)
"Hello, Fred"
%{age: "95", favorite_color: "Taupe", name: "Fred"}
# call with only the name key
...> Greeter2.hello(%{name: "Fred"})
"Hello, Fred"
%{name: "Fred"}
# call without the name key
...> Greeter2.hello(%{age: "95", favorite_color: "Taupe"})
** (FunctionClauseError) no function clause matching in Greeter2.hello/1
The following arguments were given to Greeter2.hello/1:
# 1
%{age: "95", favorite_color: "Taupe"}
iex:15: Greeter2.hello/1
So we’ve seen that Elixir pattern-matches at multiple depths because each argument matches against the incoming data independently, leaving us with the variables to call them by inside our function.
If we switch the order of %{name: person_name}
and person
in the list, we will get the same result because each are matching to fred on their own.
We swap the variable and the map:
defmodule Greeter3 do
def hello(person = %{name: person_name}) do
IO.puts "Hello, " <> person_name
IO.inspect person
end
end
And call it with the same data we used in Greeter2.hello/1
:
# call with same old Fred
...> Greeter3.hello(fred)
"Hello, Fred"
%{age: "95", favorite_color: "Taupe", name: "Fred"}
Remember that even though it looks like %{name: person_name} = person
is pattern-matching the %{name: person_name}
against the person
variable, they’re actually each pattern-matching to the passed-in argument.
Summary: Functions pattern-match the data passed in to each of its arguments independently. We can use this to bind values to separate variables within the function.
Private Functions
When we don’t want other modules accessing a specific function we can make the function private.
Private functions can only be called from within their own Module.
We define them in Elixir with defp
:
defmodule Greeter do
def hello(name), do: phrase() <> name
defp phrase, do: "Hello, "
end
iex> Greeter.hello("Sean")
"Hello, Sean"
iex> Greeter.phrase
** (UndefinedFunctionError) function Greeter.phrase/0 is undefined or private
Greeter.phrase()
Guards
We briefly covered guards in the Control Structures lesson, now we’ll see how we can apply them to named functions. Once Elixir has matched a function any existing guards will be tested.
In the following example we have two functions with the same signature, we rely on guards to determine which to use based on the argument’s type:
defmodule Greeter do
def hello(names) when is_list(names) do
names
|> Enum.join(", ")
|> hello
end
def hello(name) when is_binary(name) do
phrase() <> name
end
defp phrase, do: "Hello, "
end
iex> Greeter.hello ["Sean", "Steve"]
"Hello, Sean, Steve"
Default Arguments
If we want a default value for an argument we use the argument \\ value
syntax:
defmodule Greeter do
def hello(name, language_code \\ "en") do
phrase(language_code) <> name
end
defp phrase("en"), do: "Hello, "
defp phrase("es"), do: "Hola, "
end
iex> Greeter.hello("Sean", "en")
"Hello, Sean"
iex> Greeter.hello("Sean")
"Hello, Sean"
iex> Greeter.hello("Sean", "es")
"Hola, Sean"
When we combine our guard example with default arguments, we run into an issue. Let’s see what that might look like:
defmodule Greeter do
def hello(names, language_code \\ "en") when is_list(names) do
names
|> Enum.join(", ")
|> hello(language_code)
end
def hello(name, language_code \\ "en") when is_binary(name) do
phrase(language_code) <> name
end
defp phrase("en"), do: "Hello, "
defp phrase("es"), do: "Hola, "
end
** (CompileError) iex:31: definitions with multiple clauses and default values require a header.
Instead of:
def foo(:first_clause, b \\ :default) do ... end
def foo(:second_clause, b) do ... end
one should write:
def foo(a, b \\ :default)
def foo(:first_clause, b) do ... end
def foo(:second_clause, b) do ... end
def hello/2 has multiple clauses and defines defaults in one or more clauses
iex:31: (module)
Elixir doesn’t like default arguments in multiple matching functions, it can be confusing. To handle this we add a function head with our default arguments:
defmodule Greeter do
def hello(names, language_code \\ "en")
def hello(names, language_code) when is_list(names) do
names
|> Enum.join(", ")
|> hello(language_code)
end
def hello(name, language_code) when is_binary(name) do
phrase(language_code) <> name
end
defp phrase("en"), do: "Hello, "
defp phrase("es"), do: "Hola, "
end
iex> Greeter.hello ["Sean", "Steve"]
"Hello, Sean, Steve"
iex> Greeter.hello ["Sean", "Steve"], "es"
"Hola, Sean, Steve"
Caught a mistake or want to contribute to the lesson? Edit this page on GitHub!


When we look at a website.. our eyes follow a pattern. You might already know what i mean. ..If you dont well..
Let me Explain. You see our eyes when we first look at a page quite often start from the top of the left hand side of the page. We then following this patern look left to right ,then up and down.
Alot of print media follow this example and use it to their advantage, which answers questions as to why the website title is always on the top of the page rather than on the sides.
we see this in alot of websites but to break it down even further...
Title - top Image - below the title to the left Text - to the right of the image
and so fourth with possible credits to the web developer(s)
Chances are youve scrolled through a website before and readjusted the browser. During the process of readjusting the browser, you'll notice that the website begins folding down.. or parts of it will. For example the parts that begin folding down usually consist of the advertisements.. and then the least important parts of the website until ofcourse it gets to the main content of the website.
You'll notice on other devices such as smartphones or tablets that the website will manually adjust to the size and compress the advertisements if need be or will show the full website as it did on your desktop or laptops broswer.
nowadays it is important to have a functionality for your website where the browser can be reduce in size and the websites main contents will still be available.
As to the best of my Understanding ,Sematic structure is the Structure of the HTML code we write that can be converted and understood by both people reading your code and the browser itself.
for example the ' p ' defines for a paragraph as for the same way ' H1 ' determines the size of the header or title (or possibly just something very important).
I really enjoyed the use of negative space, using the boxes also allowed me to create a pattern for written content on the page.


Waiting for the host to start the game...
You are the judge. Wait for the other players to select a card.
You are the judge. Select a winning card.
Wait for the judge to select a winning card.
You are the judge. Select a winning card.
Wait for the judge to select a winning card.
Select a card to be played in the next round.


{% extends "gallery_template.html" %} {% import "macros/trade.html" as trade %} {% block main %}
Panels are a way to group sections within a section, and their variant, panel-border, allows the sub sections to be visually indented. GDS is a little ambiguous how to handle errors
For trade the style is slightly modified to it clear, consistent and work with the macros to create field layouts. If a field in a section has an error the 'pane' should have an 'error' class. The fields within the panel will still have an error in it's form group but the left red border styling for this will not be shown, to avoid 2 borders.
As fields in the sub panel are related to a top field, they should all be contained in a fieldset.
<fieldset>
<legend class="visually-hidden">Sector and sub-sector</legend>

Sector
<select class="form-control" id="primary-sector" name="sector">
<option value="">Select option</option>
<option>Sector one</option>
<option>Sector two</option>
</select>

Sub-sector
<select class="form-control" id="sub-sector" name="sub-sector">
<option value="">Select option</option>
<option>Sub-sector one</option>
<option>Sub-sector two</option>
</select>

</fieldset>
<fieldset>
<legend class="visually-hidden">Sector and sub-sector</legend>

Sector
You must select a sector

<select class="form-control" id="primary-sector2" name="sector">
<option value="">Select option</option>
<option>Sector one</option>
<option>Sector two</option>
</select>

Sub-sector
<select class="form-control" id="sub-sector2" name="sub-sector">
<option value="">Select option</option>
<option>Sub-sector one</option>
<option>Sub-sector two</option>
</select>

</fieldset>
<fieldset>
<legend class="visually-hidden">Sector and sub-sector</legend>

Sector
<select class="form-control" id="primary-sector3" name="sector">
<option value="">Select option</option>
<option>Sector one</option>
<option>Sector two</option>
</select>

Sub-sector
You must select a sub-sector
<select class="form-control" id="sub-sector3" name="sub-sector">
<option value="">Select option</option>
<option>Sub-sector one</option>
<option>Sub-sector two</option>
</select>

</fieldset>


{% extends "splunkdj:base_with_app_bar.html" %} {% load splunkmvc %} {% block title %}Web Framework Toolkit Overview{% endblock title %} {% block css %} {% endblock css %} {% block content %}
Welcome to the Splunk Web Framework Toolkit! This app contains a collection of examples that show you how to use the components of the Web Framework. You'll find documentation and reference information, along with code templates to help you get started. View the examples in action in this app, then look at the source code in /splunk_wftoolkit/django/splunk_wftoolkit/ to see how it's done.
If you are new to the Web Framework, read the Web Framework Overview to get started.
Splunk Web Framework components that run searches and display visualizations
Visualizations available in the Toolkit for displaying data
Examples of using the Splunk Web Framework


How to read or parse MHTML (.mht) files in java
Hi All I need to mine the **content** of most of known document files like: 1. pdf 2. html 3. doc/docx etc. For most of these file formats I am planning to use: [http://tika.apache.org/][1] But as of now `Tika` does not support MHTML (*.mht) files.. ( [http://en.wikipedia.org/wiki/MHTML][2] ) There are few examples in C# ( [http://www.codeproject.com/KB/files/MhtBuilder.aspx][3] ) but I found
Decompression of .net created gzip String in Java
I'm calling a web service that provides an XML response with multiple elements.One of the elements has a compressed response. Its a gzip archive. This gzip archiving is done using .Net. But When I try to uncompress the element using Java, I'm getting following error: java.io.IOException: Not in GZIP format at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:137) at java.util.zip.GZIPInputStream.(GZIPInputStream.java:58) at java.util.zip.GZIPInputStream.(GZIPInputStream.java:68)
Handling HTTP ContentEncoding "deflate"
What **InputStream** type should be used to handle URLConnection streams that have HTTP **Content-Encoding** set to **deflate**? For a Content-Encoding of gzip or zip I use a GZIPInputStream, no problem. For a Content-Encoding of "deflate" I have tried using **InflaterInputStream** and **DeflaterInputStream** but I get > java.util.zip.ZipException: unknown compression method at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:147) My understanding is that "deflate" encoding refers to
java.util.zip.ZipException: oversubscribed dynamic bit lengths tree
I am compressing a string using gzip, then uncompress the result, however I got the following exception, why? output: Exception in thread "main" java.util.zip.ZipException: oversubscribed dynamic bit lengths tree at java.util.zip.InflaterInputStream.read(Unknown Source) at java.util.zip.GZIPInputStream.read(Unknown Source) at Test.main(Test.java:25) public class Test { public static void main(String[]args) throws IOException{ String s="helloworldthisisatestandtestonlydsafsdafdsfdsafadsfdsfsdfdsfdsfdsfds fsadfdsfdasfassdfdfdsfdsdssdfdsfdsfd"; byte[]bs=s.getBytes(); ByteArrayOutputStream outstream = new ByteArrayOutputStream(); GZIPOutputStream gzipOut = new
java.util.zip.ZipException: too many entries in ZIP file
Hello, I am trying to write a Java class to extract a large zip file containing ~74000 XML files. I get the following exception when attempting to unzip it utilizing the java zip library: **java.util.zip.ZipException**: too many entries in ZIP file Unfortunately due to requirements of the project I can not get the zip broken down before it gets to
compressing non-binary data in java http client
I plan to use java.util.zip to compress http post data when sending it from a java client to the server(java servlet in this case). is this the best approach for reducing data load? should I use gzip as the compression alg?
GZIPInputStream and Characterset
I have a Text with Latin, Cyrillic and Chinese Characters containing. I try to compress a String (over `bytes[]`) with `GZIPOutputStream` and decompress it with GZIPInputStream. But I do not manage to convert all Characters back to the original Characters. Some appear as `?`. I thought that UTF-16 will do the job. Any help? Regards Here's my code: import java.io.ByteArrayInputStream;
java.util.zip.ZipException: ZipFile closed in Websphere deployment
Hi all, I am trying to deploy my ear in a websphere clustered environment but I always encounter the following error: org.eclipse.jst.j2ee.commonarchivecore .internal.exception.SaveFailureException: WEB-INF/lib/batik.jar Stack trace of nested exception: java.util.zip.ZipException: ZipFile closed When I deploy the ear locally, no issues arises. Can anyone please advice me on this? Thanks
Is there an official (or common) file extention or suffix for deflated files?
Gzipped files typically end in `.gz`. But, is there an official (or common) file extension or suffix for [deflated][1] files? I could not find any. [1]: h ttp://docs.oracle.com/javase/6/docs/api/java/util/zip/DeflaterOutputStream.htm l
how to compress a String?
I use GZIPOutputStream or ZIPOutputStream to compress a String( my string.length() is less than 20), but the compress result is longer than original string. on some site, I found some friends said this is because my original string is too short, GZIPOutputStream is only do use to compress long string. so, can somebody give me a help to compress a
farmed deployment on Tomcat doesn't work correctly
I'm trying to set farmed WAR deployment between two Tomcat servers, which are united in cluster. I think the WAR file hasn't been copied yet, but deployment already starts - Tomcat throws following exception: java.util.zip.ZipException: invalid CEN header (bad signature) at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.(Unknown Source) at java.util.jar.JarFile.(Unknown Source) ... Could you tell me how to avoid this problem?
decompress a winrar archive programatically
hi, How could I programatically decompress a winrar archive in java ? What about zip or gzip files ?
Java: Gzip string to output string
How do I take a string and use something like [GZIPOutputStream][1] to gzip the string and then output the zipped content as a string. My intention is to transfer the zipped content as a post variable through HTTP. [1]: http://ermalaev.spb.ru/j2se/1.4.2/docs/api/java/util/zip/GZIPOutputStream.html
gunzip a soap response
I want to use a soap web service to get some xml gzipped data . The problem is when I got the response message from server , it is zipped using gzip . How can I gunzip it ?? (java solution is preferred) It seems that the server only present gzipped type of response and when I specify to not
Running jboss6.0 -[org.jboss.deployers.vfs.structure] Exception looking for WEB-INF/lib, / java.util.zip.ZipException: error in opening zip file
hi, i am using jboss 6.0 while running got following Exception plz help me out [org.jboss.deployers.vfs.structure] Exception looking for WEB-INF/lib, / java.util.zip.ZipException: error in opening zip file
Closing ZipOutputStream
Hello! I'm a bit confused. I know that an empty zip is not legal. But what about this sample snippet: ZipOutputStream zos = null; try { zos = new ZipOutputStream(new FileOutputStream("...")); // //.. // } finally { zos.close(); } If no zip entries had been added for some reason (possibly exceptional situation) then the following exception will be thrown on
ZIP Using Oracle Stored Procedure
Right now I am using Oracle utility procedure, `UTL_COMPRESS.LZ_COMPRESS()`, to compress some data. But the problem is it compresses the thing using GZIP compatible format, which is not also ZIP compatible unfortunately. Therefore, the Windows XP native decompression utility can not open it (you know that compressed folder thingie). And user need to use some utility like `7Zip`, `Winzip`, or
Is possible keeps the contents of all files inside within a compressed tar.gz, like a stream??
Hi guys, I have a problem to resolve. I have tar.gz compressed file, and I wouldLike keep the contents like a stream, like Zipfile permits with the method zipFile.getInputStream(zipEntry). I have Implemented using ant library, the code: TarInputStream is = new TarInputStream(gzipInputStream); while((entryx = is.getNextEntry()) != null) { if (entryx.isDirectory()) continue; else { InputStream tmpIn = new StreamingTarEntry(is, entryx.getSize()); BufferedReader
What is the Java 7 try-with-resources bytecode equivalent using try-catch-finally?
I'm trying to understand how the new [try-with-resources statement][1] works by recreating it using regular try-catch-finally statements. Given the following test class using Java 7 try-with-resources: import java.io.IOException; import java.util.zip.GZIPOutputStream; public class TryWithResources { public static void main(String[] args) { try (GZIPOutputStream gzip = new GZIPOutputStream(System.out)) { gzip.write("TEST".getBytes("UTF-8")); } catch (IOException ioe) { ioe.printStackTrace(); } } } How would you
How do I parse the gzip file header from a gzip stream in C#?
I am forced to use an older version of the SharpZipLib and the standard Microsoft libraries to perform this. I have a gziped file whose name is different than the filename inside the archive. I need to parse the gzip file header to return the original filename. Here is documentation on the gzip website: [http://www.gzip.org/zlib/rfc-gzip.html#conventions][1] And a java example that
How to explain this error:ZipInputStream.java:330
I have a android app: and I post a zip file(400MB,contains some jpg,html and other files) to a server, and download this zip file to my sdcard and unzip it in the same level folder with sdcard, but I always got the exception:[**System.err: java.util.zip.ZipInputStream.read(ZipInputStream.java:330)**] when I unzip the zip , and when I unzip other large zip files I have
GZip a string for output from Coldfusion results in "Content Encoding Error" in browsers
I am trying to GZip content in a variable to output to the browser. To start I am making this very simple and not worrying about browsers that do not support gzip. Also I have put this together from researching several methods that I could find on the web. Some of them from people that may be reading this question.
Reading ZIP file gives an 'invalid LOC header' Exception
I have a large zip file, 4.3G. It contains about 100k entries. I am reading it using Java 1.6.0_14 on Linux, Ubuntu 32 bit, and get the following exception. java.util.zip.ZipException: invalid LOC header (bad signature) at java.util.zip.ZipFile.read(Native Method) at java.util.zip.ZipFile.access$1200(ZipFile.java:29) at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:447) at java.util.zip.ZipFile$1.fill(ZipFile.java:230) at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read1(BufferedInputStream.java:258) at java.io.BufferedInputStream.read(BufferedInputStream.java:317) at java.io.FilterInputStream.read(FilterInputStream.java:90) I don't have issues with any
Problem creating a multiple entry zip file with java
ANyone know whats wrong with this code for creating a zip file containing a number of entries private File zipAttachments(List licenses) throws IOException { byte[] buf = new byte[1024]; File licenseZip = new File("license.zip"); FileOutputStream fos = new FileOutputStream(licenseZip); ZipOutputStream zip = new ZipOutputStream(fos); for(File license:licenses) { ZipEntry zipEntry = new ZipEntry(license.getName()); FileInputStream in = new FileInputStream(license); zip.putNextEntry(zipEntry); int len;
How to Compress/Decompress tar.gz files in java
Can anyone show me the correct way to compress and decompress tar.gzip files in java i've been searching but the most i can find is either zip or gzip(alone).


Converter of the temperatures, masses, lengths and speeds
Convert measures in some clicks
Temperature
Mass
Length
Speed


<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the institution's department to which this
location belongs, or its cost center. Refer to User-defined Table 0264 -
Location department for suggested values.
Value |
Description |
|---|---|
No suggested values defined |
Definition:
This field contains the hospital or ancillary service with which this location
is associated. Depends on institution use. Repeats for rooms that can be
used, for example, by different services on different days. These values
should match the values used for PV1-10 - Hospital service, which
is site defined. Refer to User-defined Table 0069 - Hospital
service for suggested values.
Value |
Description |
|---|---|
No suggested values defined |
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the specialty type (if any) of the department
or clinic. This may also be considered a bed type. Specialty type is a
physical accommodation type, whereas `accommodation type' (LCC-3 -
Accommodation type) is a financial accommodation type. Refer to
User-defined Table 0265 - Specialty type for suggested values.
See also LCH-4 - Location characteristic ID and LHC-5 -
Location characteristic value.
Value |
Description |
|---|---|
AMB |
Ambulatory |
PSY |
Psychiatric |
PPS |
Pediatric psychiatric |
REH |
Rehabilitation |
PRE |
Pediatric rehabilitation |
ISO |
Isolation |
OBG |
Obstetrics, gynecology |
PIN |
Pediatric/neonatal intensive care |
INT |
Intensive care |
SUR |
Surgery |
PSI |
Psychiatric intensive care |
EDI |
Education |
CAR |
Coronary/cardiac care |
NBI |
Newborn, nursery, infants |
CCR |
Critical care |
PED |
Pediatrics |
EMR |
Emergency |
OBS |
Observation |
WIC |
Walk-in clinic |
PHY |
General/family practice |
ALC |
Allergy |
FPC |
Family planning |
CHI |
Chiropractic |
CAN |
Cancer |
NAT |
Naturopathic |
OTH |
Other specialty |
Definition: This field contains the patient types that are allowed to be assigned to this bed. For example, Inpatient, Outpatient, Series, Clinic, ER, Ambulatory, Observation, etc. These values should be the same set of values as those used for PV1-2 - Patient class. Refer to User-defined Table 0004 - Patient class for suggested values.
Definition: This field indicates whether the entry for this location is currently an active, that is, valid, usable entry (disregarding whether it's waiting to be maintained by housekeeping). Refer to HL7 Table 0183 - Active/inactive for valid values.
Definition: This field contains the date and time when the location became active or "in service" for a department (disregarding whether it is waiting to be maintained by housekeeping).
Definition: This field contains the date when the location became inactive or "out of service" for this department (disregarding whether it is waiting to be maintained by housekeeping).
Definition: This field contains the reason the location was put out of service. It is used when LDP-8 - Inactivation date-LDP is sent.
Components:
<start day range (ID)> ^ <end day range (ID)> ^ <start hour
range (TM)> ^ <end hour range (TM)>
Definition: This field contains the hours when this location is open for
visiting. Refer to HL7 Table 0267 - Days of the week for
valid values for the first two components.
Value |
Description |
|---|---|
SAT |
Saturday |
SUN |
Sunday |
MON |
Monday |
TUE |
Tuesday |
WED |
Wednesday |
THU |
Thursday |
FRI |
Friday |
Components:
[NNN] [(999)]999-9999 [X99999] [B99999] [C any text] ^
<telecommunication use code (ID)> ^ <telecommunication equipment type
(ID)> ^ <email address (ST)> ^ <county code (NM)> ^
<area/city code (NM)> ^ <phone number (NM) ^ <extension (NM)> ^
<any text (ST)>
Definition: This field contains the phone number to use to contact facility
personnel about the patient location, in case of inquiries about the location.
This phone is not necessarily within the named patient location.
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the cost center to which this location
belongs. Refer to User-defined Table 0462 - Location cost
center for suggested values.
Value |
Description |
|---|---|
No suggested values defined |
The
Technical Steward for the LCC segment is PAFM.
The optional LCC segment identifies how a patient location room can be billed
by a certain department. A department can use different charge codes for the
same room or bed, so there can be multiple LCC segments following an LDP
segment.
SEQ |
LEN |
DT |
OPT |
RP/# |
TBL# |
ITEM# |
ELEMENT NAME |
|---|---|---|---|---|---|---|---|
1 |
200 |
PL |
R |
00979 |
Primary Key Value - LCC |
||
2 |
250 |
CE |
R |
0264 |
00964 |
Location Department |
|
3 |
250 |
CE |
O |
Y |
0129 |
00980 |
Accommodation Type |
4 |
250 |
CE |
R |
Y |
0132 |
00981 |
Charge Code |
Components:
<point of care (IS)> ^ <room (IS)> ^ <bed (IS)> ^
<facility (HD)> ^ <location status (IS)> ^ <person location
type (IS)> ^ <building (IS)> ^ <floor (IS)> ^ <location
description (ST)>
Subcomponents of facility: <namespace ID (IS)> & <universal
ID (ST) & <universal ID Type (ID)
Definition: This field contains the institution's identification code for the
location. The identifying key value. This field has the same components as
the patient location fields in the PV1 segment (except that bed status is not
included here). At least the first component of this field is required. The
content of this field must exactly match the content of its preceding MFE
(MFE-4 - Primary key value - MFE), its preceding LOC (LOC-1
- LOC primary key value), and its preceding LDP (LDP-1 - Primary
key value - LDP).
Definition: This field contains the institution's department to which this location belongs, or its cost center. It may match the value in its preceding LDP (LDP-2 - Location department or LDP-12 - Location cost center. Refer to User-defined Table 0264 - Location department for suggested values.
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the financial accommodation type of the bed or
room which implies the rate to be used when occupied by a patient under
specific medical conditions, which determines how it is billed. Not the same
as specialty type. Used for general ledger categories. Specialty type is a
physical accommodation type, whereas this field is a financial accommodation
type. Repeating coded value. Refer to User-defined Table 0129 -
Accommodation code for suggested values.
Value |
Description |
|---|---|
No suggested values defined |
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the repeating coded entry for codes
identifying how the use of this location is to be charged. For
cross-referencing beds master files with the charge master files, or for
generating charges when a patient is assigned to a bed. These should be the
same set of values used in FT1-7 -Transaction code.
Refer to User-defined Table 0132 - Transaction code for suggested
values.
MSH|^~\&|HL7REG|UH|HL7LAB|CH|19910918060544||MFN^M05|MSGID002|P|2.4||AL|NE<cr>
MFI|LOC||UPD|||AL<cr>
MFE|MAD|PMF98123789182|199110011230|3A^RM17^17-2^FAC1<cr>
LOC|3A^RM17^17-2^FAC1|BEST BED IN UNIT|B|UNIVERSITY HOSPITAL|54326 SAND P0INT
WAY^^SEATTLE^WA^98199|(206)689-1329|92837465998|OXY<cr>
LCH|3A^RM17^17-2^FAC1|||IMP|Y<cr>
LRL|3A^RM17^17-2^FAC1|||LAB|3WEST PATH LAB<cr>
LDP|3A^RM17^17-2^FAC1|PED|MED|PIN|I|A|19941004||||(206)689-1363<cr>
LCC|3A^RM17^17-2^FAC1|PED|PIC|R38746<cr>
The
charge description (CDM) master file segment should be used in conjunction with
the general master file segments in Section 8.5, "GENERAL MASTER FILE
SEGMENTS." Interfacing systems often need not only to communicate data about a
patient's detailed charges, but also to communicate the charge identification
entries by which an application knows how to handle a particular charge code.
The charge description master is a master file. The CDM segment below is a
specially designed master file segment for interfacing charge description
masters. In the following message, the MFI-master file identifier should equal
"CDM." When the CDM segment is used in an MFN message, the abstract definition
is as follows:
MFN^M04^MFN_M04 |
Master File Notification |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MFI |
Master File Identification |
8 |
{MFE |
Master File Entry |
8 |
CDM |
Charge Description Master |
8 |
{ [PRC] } |
Price Segment |
8 |
} |
MFK^M04^MFK_M01 |
Master File Acknowledgment |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MSA |
Acknowledgment |
2 |
MFI |
Master File Identification |
8 |
{ [MFA] } |
Master File ACK segment |
8 |
Master
File Response Message: When the CDM segment is used in the MFR message, the
part of the message represented by:
{MFE |
||
[Z..] } |
is
replaced by:
{MFE |
||
CDM |
|
|
{ [PRC] } |
|
|
} |
The
Technical Steward for the CDM segment is PAFM.
The CDM segment contains the fields for identifying anything which is charged
to patient accounts, including procedures, services, supplies. It is intended
to be used to maintain a list of valid chargeable utilization items. Its
purpose is to keep billing codes synchronized between HIS, Patient Accounting,
and other departmental systems. It is not intended to completely support
materials management, inventory, or complex pricing structures for which
additional complex fields would be required. Given an identifying charge code,
the associated fields in the charge description master file will provide basic
pricing and billing data. All the additional information necessary for patient
accounting systems to do billing and claims is not intended to be included in
this segment; those should be part of insurance or billing profile tables.
The CDM segment contains the fields which, for one chargeable item, remain the
same across facilities, departments, and patient types. The following PRC
segment contains the fields which, for the same chargeable item, vary depending
upon facility or department or patient type.
SEQ |
LEN |
DT |
OPT |
RP/# |
TBL# |
ITEM# |
ELEMENT NAME |
|---|---|---|---|---|---|---|---|
1 |
250 |
CE |
R |
0132 |
01306 |
Primary Key Value - CDM |
|
2 |
250 |
CE |
O |
Y |
9999 |
00983 |
Charge Code Alias |
3 |
20 |
ST |
R |
00984 |
Charge Description Short |
||
4 |
250 |
ST |
O |
00985 |
Charge Description Long |
||
5 |
1 |
IS |
O |
0268 |
00986 |
Description Override Indicator |
|
6 |
250 |
CE |
O |
Y |
9999 |
00987 |
Exploding Charges |
7 |
250 |
CE |
O |
Y |
0088 |
00393 |
Procedure Code |
8 |
1 |
ID |
O |
0183 |
00675 |
Active/Inactive Flag |
|
9 |
250 |
CE |
O |
Y |
0463 |
00990 |
Inventory Number |
10 |
12 |
NM |
O |
00991 |
Resource Load |
||
11 |
250 |
CK |
O |
Y |
00992 |
Contract Number |
|
12 |
250 |
XON |
O |
Y |
00993 |
Contract Organization |
|
13 |
1 |
ID |
O |
0136 |
00994 |
Room Fee Indicator |
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the code assigned by the institution for the
purpose of uniquely identifying the thing that can be charged. The key field
of the entry. For example, this field would be used to uniquely identify a
procedure, item, or test for charging purposes. Probably the same set of
values as used in FT1-7- Transaction code in financial messages.
Must match MFE-4 - Primary key value - MFE. Refer to
User-defined Table 0132 - Transaction for suggested values. See Chapter
7 for discussion of the universal service ID.
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains an alternative charge code. For example,
points to another charge description master entry in cases where one code
supersedes or overrides another code. Repeating field allows for different
codes used by different systems which should be handled as if they were the
same; for example, the general ledger code may differ from the billing code.
Or, in a multi-facility environment which does facility-specific pricing, there
may be more than one of these master file entries for one charge description,
each with a different facility.
Definition: This field contains the text abbreviations or code that is associated with this CDM entry.
Definition: This field contains the full text description of this CDM entry.
Definition:
This field indicates whether this CDM entry's description can be overridden.
Refer to User-defined Table 0268 - Override for suggested
values.
Value |
Description |
|---|---|
X |
Override not allowed |
A |
Override allowed |
R |
Override required |
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the repeating occurrences for a list of other
CDM entry charge codes identifying the other charges which should be generated
from this CDM entry. If non-null, posting a charge to this CDM entry should
result in posting the charges identified here. These are sometimes called
"linked items."
In the case of "chained" charges where the "lead" charge must be included in
the exploded charges, the "lead" charge should be included in the list of
exploding charges. If the price of this parent charge is included in the
message, then it overrides the sum of the exploded charges prices.
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the procedure code for procedure, if any,
associated with this charge description. Repeating field allows for different
procedure coding systems such as CPT4, ASTM, ICD9. Coded entry made up of code
plus coding schema. Refer to User defined Table 0088 - Procedure code
for suggested values.
Definition: This field indicates whether this is a usable CDM entry. Refer to HL7 table 0183 - Active/inactive for valid values.
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This optional field contains an identifying stock number, if any,
which might be used, for example, as a cross reference for materials
management. Refer to User-defined Tabl
e
0463 - Inventory number for suggested values.
Value |
Description |
|---|---|
No suggested values |
Definition: This field contains the Relative Value Unit (RVU) minutes and ATS, a factor related to CPT4 coding and to pricing structure for physical billing.
Components:
<ID number (NM)> ^ <check digit (NM)> ^ <code identifying the
check digit scheme employed (ID)> ^ <assigning authority
(HD)>
Type Subcomponents of assigning authority: <namespace ID (IS)> &
<universal ID (ST) & <universal ID (ID)
Definition: This field contains any contract number pertaining to this
chargeable item. For example, supplier contract or service contract.
Components:
<organization name (ST)> ^ <organization name type code (IS)> ^
<ID number (NM)> ^ <check digit (NM)> ^ <code identifying the
check digit scheme employed (ID)> ^ <assigning authority (HD)> ^
<identifier type code (IS)> ^ <assigning facility ID (HD)> ^
<name representation code (ID)>
Subcomponents of assigning authority: <namespace ID (IS)> &
<universal ID (ST)> & <universal ID type (ID)>
Subcomponents of assigning facility ID: <namespace ID (IS)> &
<universal ID (ST)> & <universal ID type (ID)>
Definition: This field contains the organization with whom there is a
contractual arrangement for providing the service or material used for this
chargeable item.
Definition:
This field contains a room fee indicator. Refer to HL7 Table 0136 -
Yes/no indicator for valid values.
Y this is a component of the room fees
N this is any other chargeable item other than room fees
The
Technical Steward for the PRC segment is PAFM.
The PRC segment contains the pricing information for the preceding CDM
segment's chargeable item. It contains the fields which, for the same
chargeable item, might vary depending upon facility or department or patient
type. The preceding CDM segment contains the fields which, for one chargeable
item, remain the same across facilities, departments, and patient types.
SEQ |
LEN |
DT |
OPT |
RP/# |
TBL# |
ITEM# |
ELEMENT NAME |
|---|---|---|---|---|---|---|---|
1 |
250 |
CE |
R |
0132 |
00982 |
Primary Key Value - PRC |
|
2 |
250 |
CE |
O |
Y |
0464 |
00995 |
Facility ID - PRC |
3 |
250 |
CE |
O |
Y |
0184 |
00676 |
Department |
4 |
1 |
IS |
O |
Y |
0004 |
00967 |
Valid Patient Classes |
5 |
12 |
CP |
C |
Y |
00998 |
Price |
|
6 |
200 |
ST |
O |
Y |
00999 |
Formula |
|
7 |
4 |
NM |
O |
01000 |
Minimum Quantity |
||
8 |
4 |
NM |
O |
01001 |
Maximum Quantity |
||
9 |
12 |
MO |
O |
01002 |
Minimum Price |
||
10 |
12 |
MO |
O |
01003 |
Maximum Price |
||
11 |
26 |
TS |
O |
01004 |
Effective Start Date |
||
12 |
26 |
TS |
O |
01005 |
Effective End Date |
||
13 |
1 |
IS |
O |
0268 |
01006 |
Price Override Flag |
|
14 |
250 |
CE |
O |
Y |
0293 |
01007 |
Billing Category |
15 |
1 |
ID |
O |
0136 |
01008 |
Chargeable Flag |
|
16 |
1 |
ID |
O |
0183 |
00675 |
Active/Inactive Flag |
|
17 |
12 |
MO |
O |
00989 |
Cost |
||
18 |
1 |
IS |
O |
0269 |
01009 |
Charge On Indicator |
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the code assigned by the institution for the
purpose of uniquely identifying the thing that can be charged. The key field
of the entry. For example, this field would be used to uniquely identify a
procedure, item, or test for charging purposes. Probably the same set of
values as used in FT1-7 - Transaction code in financial messages.
Must match MFE-4 - Primary key - MFE and CDM-1 -
Primary key - CDM. Refer to User-defined Table 0132 - Transaction
code for suggested values. See Chapter 7 for discussion of the universal
service ID.
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the facility of the institution for which this
price (for the preceding CDM entry) is valid. For use when needing
multi-facility pricing. If null, assume all facilities. In a multi-facility
environment, the facility associated with this chargeable item may not be the
same as the sending or receiving facility identified in the MSH segment. Use
only when the price is not the same for all facilities, that is, a null value
indicates that this pricing is valid for all facilities.
When two PRC segments are sent with the same key values but different facility
identifiers, the second is sent in addition to the first, not to replace the
first. The effective unique identifier is the charge code (PRC-1
- Primary key value - PRC) plus the facility ID
(PRC-2 - Facility ID). Multiple facility
identifiers can be sent in the same segment to indicate that those facilities
use the same pricing. Refer to User-defined Table 0464 - Facility
ID for suggested values.
Value |
Description |
|---|---|
No suggested values defined |
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the department of the facility which accrues
revenue/cost for this type of charge. When pricing is different for different
departments within the same facility, this will indicate for which department
the following pricing information is valid. Use only when the price is not the
same for all departments, that is, a null value indicates that this pricing is
valid for all departments.
When two PRC segments are sent the same key values but with different
departments, the second is sent in addition to the first, not to replace the
first. The effective unique identifier is the charge code (PRC-1
- Primary key - PRC) plus the facility ID (PRC-2 -
Facility ID) plus the department (PRC-3 -
Department). Multiple departments can be sent in the same
segment to indicate that those departments use the same pricing. Refer
to User-defined Table 0184 - Department for suggested values.
Definition:
This field contains the patient types for which this charge description is
valid. For example, Inpatient, Outpatient, Series, Clinic, ER, Ambulatory,
Observation, etc. These values should be the same set of values as those used
for PV1-3 - Patient class, which is site defined. Use only when
the price is not valid for all patient types, that is, a null value indicates
that this pricing is valid for all patient classes. Refer to User-defined
Table 0004 - Patient class for suggested values.
When two PRC segments are sent the same key values but with different valid
patient classes, the second is sent in addition to the first, not to replace
the first. The effective unique identifier is the charge code
(PRC-1 - PRC primary key) plus the facility ID
(PRC-2 - Facility ID) plus the department
(PRC-3 - Department) plus the patient class
(PRC-4 - Valid patient classes). Multiple patient
classes can be sent in the same segment to indicate that those patient classes
use the same pricing.
Components:
<price (MO)> ^ <price type (ID)> ^ <from value (NM)> ^
<to value (NM)> ^ <range units (CE)> ^ <range type
(ID)>
Subcomponents of price: <quantity (NM)> & <denomination
(ID)>
Subcomponents of range nits: <identifier (ST)> & <text (ST)
& <name of coding system (IS)> & <alternate identifier
(ST)> & <alternate text (ST)> & <name of alternate coding
system (ST)>
Definition: This field contains the price to be charged for service, item, or
procedure. If CDM price will always be overridden when charges are posted,
then this field is optional. Otherwise, price would be a required field. The
formula or calculation that is to be used to get total price from these price
components is left to implementation negotiations agreed upon by the
participating institutions. See Chapter 2, Section 2.8.8, "CP - composite
price," for a description of the use of the composite price (CP) data type.
Definition: This field contains the mathematical formula to apply to PRC-5 - Price in order to compute total price. The syntax of this formula must conform to Arden Syntax rules.
Definition: This field contains the minimum number of identical charges allowed on one patient account for this CDM entry.
Definition: This field contains the maximum number of identical charges allowed on one patient account for this CDM entry.
Components:
<quantity (NM)> ^ <denomination (ID)>
Definition: This field contains the minimum total price (after computation of
components of price) that can be charged for this item.
Components:
<quantity (NM)> ^ <denomination (ID)>
Definition: This field contains the maximum total price (after computation of
components of price) that can be charged for this item.
Definition: This field contains the date/time when this CDM entry becomes effective.
Definition: This field contains the date/time when this CDM entry is no longer effective.
Definition: This field indicates whether this CDM entry's price can be overridden. Refer to User-defined Table 0268 - Override for suggested values.
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains the billing category codes for any
classification systems needed, for example, general ledger codes and UB92
categories. Repeating field with coded entry made up of category code plus
category system. Refer to User-defined Table 0293 - Billing
category for suggested values.
Value |
Description |
|---|---|
No suggested values defined |
Definition:
This field contains a chargeable indicator. Refer to HL7 Table
0136 - Yes/no indicator for valid values.
N charge is not billable, that is, do not create charges for this CDM entry;
this is zero price item
Y item is billable (this is also the default when NULL)
Definition: This indicates whether this is a usable CDM entry. Refer to HL7 Table 0183 - Active/inactive for valid values.
Components:
<quantity (NM)> ^ <denomination (ID)>
Definition: This field contains the institution's calculation of how much it
costs to provide this item, that is, what the institution had to pay for the
material plus any specified payment expenditure, effort or loss due to
performing or providing the chargeable item.
Definition:
This field contains the user-defined table of values which indicates when a
charge for services or procedures should be accrued. Refer to
User-defined Table 0269 - Charge on indicator for suggested
values.
Value |
Description |
|---|---|
O |
Charge on Order |
R |
Charge on Result |
MSH|^~\&|HL7REG|UH|HL7LAB|CH|19910918060544||MFN^M04|MSGID002|P|2.4||AL|NE<cr>
MFI|CDM||UPD|||AL<cr>
MFE|MAD|CDM98123789182|199110011230|P2246^^PLW<cr>
CDM|P2246^^PLW |2445||APPENDECTOMY|X||244.34|A|2321||||N<cr>
PRC|P2246^^PLW |FAC3|SURG|O~A|100.00^UP |formula |1|1
|100.00^USD|1000.00^USD|19941031||Y|GL545|Y|A|<cr>
The
CM0 (Clinical Study Master), CM1 (Clinical Study Phase), and CM2 (Clinical
Study Schedule) segments can be used to transmit master files information
between systems. The CM0 segment contains the information about the study
itself; the CM1 contains the information about one phase of the study
identified in the preceding CM0; and the CM2 contains the information about the
scheduled time points for the preceding study or phase-related treatment or
evaluation events. When these segments are used in an MFN message, the
abstract definition is described below.
Case 1: MFN message for Clinical Study with phases and schedules
MFI-1 - master file identifier code = CMA
MFN^M06^MFN_M06 |
Master File Notification |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MFI |
Master File Identification |
8 |
{ MFE |
Master File Entry |
8 |
CM0 |
Clinical Study Master |
8 |
[{ CM1 |
Clinical Study Phase |
8 |
[{CM2}] }] |
Clinical Study Schedule |
8 |
} |
MFK^M06^MFK_M01 |
Master File Acknowledgment |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MSA |
Acknowledgment |
2 |
MFI |
Master File Identification |
8 |
{ [MFA] } |
Master file ACK |
8 |
Case 2: MFN message for Clinical Study without phases but with
schedules
MFI-1 - master file identifier code = CMB
MFN^M07^MFN_M07 |
Master File Notification |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MFI |
Master File Identification |
8 |
{ MFE |
Master File Entry |
8 |
CM0 |
Clinical Study Master |
8 |
[ {CM2}] |
Clinical Study Schedule |
8 |
} |
MFK^M07^MFK_M01 |
Master File Acknowledgment |
Chapter |
|---|---|---|
MSH |
Message Header |
2 |
MSA |
Acknowledgment |
2 |
MFI |
Master File Identification |
8 |
{ [MFA] } |
Master file ACK |
8 |
When
the Clinical Trials master segments are used in the MFR message, the part of
the message represented by:
MFE
[Z..] }
is replaced by, in case 1 above:
{ MFE
CM0
[{ CM1
[ {CM2}]
}
In case 2 above, the corresponding segments in the MFR message represented
by:
{MFE
[Z..] }
are replaced by
{ MFE
CM0
[ {CM2}] }]
}
The
Technical Steward for the CM0 segment is ORDERS.
The Clinical Study Master (CM0) segment contains the information about the
study itself. The sending application study number for each patient is sent in
the CSR segment. The optional CM0 enables information about the study at the
sending application that may be useful to the receiving systems. All of the
fields in the segment describe the study status at the sending facility unless
otherwise agreed upon.
SEQ |
LEN |
DT |
OPT |
RP/# |
TBL# |
ITEM# |
ELEMENT NAME |
|---|---|---|---|---|---|---|---|
1 |
4 |
SI |
O |
01010 |
Set ID - CM0 |
||
2 |
60 |
EI |
R |
01011 |
Sponsor Study ID |
||
3 |
60 |
EI |
O |
Y/3 |
01036 |
Alternate Study ID |
|
4 |
300 |
ST |
R |
01013 |
Title of Study |
||
5 |
250 |
XCN |
O |
Y |
01014 |
Chairman of Study |
|
6 |
8 |
DT |
O |
01015 |
Last IRB Approval Date |
||
7 |
8 |
NM |
O |
01016 |
Total Accrual to Date |
||
8 |
8 |
DT |
O |
01017 |
Last Accrual Date |
||
9 |
250 |
XCN |
O |
Y |
01018 |
Contact for Study |
|
10 |
250 |
XTN |
O |
01019 |
Contact's Telephone Number |
||
11 |
250 |
XAD |
O |
Y |
01020 |
Contact's Address |
Definition: This field contains a number that uniquely identifies this transaction for the purpose of adding, changing, or deleting the transaction. For those messages that permit segments to repeat, the Set ID field is used to identify the repetitions.
Components:
<entity identifier (ST)> ^ <namespace ID (IS)> ^ <universal ID
(ST)> ^ <universal ID type (ID)>
Definition: This field contains the study number established by the study
sponsor. Please see discussion in Section <IP_ADDRESS>, "Sponsor study ID."
Components:
<entity identifier (ST)> ^ <namespace ID (IS)> ^ <universal ID
(ST)> ^ <universal ID type (ID)>
Definition: This field contains the local or collaborators' cross-referenced
study numbers.
Definition: This field contains the sending institution's title for the clinical trial. It gives recipients further identification of the study.
Components:
<ID number (ST)> ^ <family name (FN)> ^ <given name (ST)> ^
<second or further given names or initials thereof (ST)> ^ <suffix
(e.g., JR or III) (ST)> ^ <prefix (e.g., DR) (ST)> ^ <degree (e.g.,
MD) (IS)> ^ <source table (IS)> ^ <assigning authority (HD)> ^
<name type code (ID)> ^ <identifier check digit (ST)> ^ <code
identifying the check digit scheme employed (ID)> ^ <identifier type code
(IS)> ^ <assigning facility (HD)> ^ <name representation code
(ID)> ^ <name context (CE)> ^ <name validity range (DR)> ^ <
name assembly order (ID)>
Subcomponents of family name: <family name (ST)> & <own
family name prefix (ST)> & <own family name (ST)> & <family
name prefix from partner/spouse (ST)> & <family name from
partner/spouse (ST)>
Subcomponents of assigning authority: <namespace ID (IS)> &
<universal ID (ST)> & <universal ID type (ID)>
Subcomponents of assigning facility ID: <namespace ID (IS)> &
<universal ID (ST)> & <universal ID type (ID)>
Definition: This field contains the sending institution's chairman. It
further identifies the study. The chairman's name may be needed for
communication purposes.
Definition: This field contains an institution's Internal Review Board approval dates which are required annually to continue participation in a clinical trial.
Definition: This field is a quality control field to enable checks that patient data have been transmitted on all registered patients.
Definition: This field contains the status information on the patient registration activity for quality control and operations purposes.
Components:
<ID number (ST)> ^ <family name (FN)> ^ <given name (ST)> ^
<second or further given names or initials thereof (ST)> ^ <suffix
(e.g., JR or III) (ST)> ^ <prefix (e.g., DR) (ST)> ^ <degree (e.g.,
MD) (IS)> ^ <source table (IS)> ^ <assigning authority (HD)> ^
<name type code (ID)> ^ <identifier check digit (ST)> ^ <code
identifying the check digit scheme employed (ID)> ^ <identifier type code
(IS)> ^ <assigning facility (HD)> ^ <name representation code
(ID)> ^ <name context (CE)> ^ <name validity range (DR)> ^ <
name assembly order (ID)>
Subcomponents of family name: <family name (ST)> & <own
family name prefix (ST)> & <own family name (ST)> & <family
name prefix from partner/spouse (ST)> & <family name from
partner/spouse (ST)>
Subcomponents of assigning authority: <namespace ID (IS)> &
<universal ID (ST)> & <universal ID type (ID)>
Subcomponents of assigning facility ID: <namespace ID (IS)> &
<universal ID (ST)> & <universal ID type (ID)>
Definition: This field contains the name of the individual who should be
contacted for inquiries about data transmitted for this study.
Components:
[NNN] [(999)]999-9999 [X9999] [C any text] ^ <telecommunication use code
(ID)> ^ <telecommunication equipment type (ID)> ^ <email address
(ST)> ^ <county code (NM)> ^ <area/city code (NM)> ^ <phone
number (NM)> ^ <extension (NM)> ^ <any text (ST)>
Definition: This field contains the phone number of the study contact
identified in CM0-9 - Contact for study.
Components:
In Version 2.3 and later, replaces the AD data type. <street address
(SAD)> ^ <other designation (ST)> ^ <city (ST)> ^ <state or
province (ST)> ^ <zip or postal code (ST)> ^ <country (ID)> ^
< address type (ID)> ^ <other geographic designation (ST)>
^ <county/parish code (IS)> ^ <census tract (IS)> ^
<address representation code (ID)> ^ <address validity range
(DR)>
Subcomponents of street address: <street address (ST)> &
<street name (ST)> & <dwelling number (ST)>
Definition: This field contains the address of the study contact identified in
CM0-9 - Contact for study.
The
Technical Steward for the CM1 segment is ORDERS.
Each Clinical Study Phase Master (CM1) segment contains the information about
one phase of a study identified in the preceding CM0. This is an optional
structure to be used if the study has more than one treatment or evaluation
phase within it. The identification of study phases that the patient enters
are sent in the CSP segment: sequence 2. The CM1 segment describes the phase
in general for the receiving system.
SEQ |
LEN |
DT |
OPT |
RP/# |
TBL# |
ITEM# |
ELEMENT NAME |
|---|---|---|---|---|---|---|---|
1 |
4 |
SI |
R |
01021 |
Set ID - CM1 |
||
2 |
250 |
CE |
R |
01022 |
Study Phase Identifier |
||
3 |
300 |
ST |
R |
01023 |
Description of Study Phase |
Definition: This field contains a number that uniquely identifies this transaction for the purpose of adding, changing, or deleting the transaction. For those messages that permit segments to repeat, the Set IF field is used to identify the repetitions.
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field should correspond to the study phase ID coding system
in Section <IP_ADDRESS>, "Study phase ID."
Definition: This field contains a brief explanation for recipients to understand what the phase represents.
The
Technical Steward for the CM2 segment is ORDERS.
The Clinical Study Schedule Master (CM2) contains the information about the
scheduled time points for study or phase-related treatment or evaluation
events. The fact that a patient has data satisfying a scheduled time point is
sent in the CSS segment, sequence 2. The CM2 segment describes the scheduled
time points in general.
SEQ |
LEN |
DT |
OPT |
RP/# |
TBL# |
ITEM# |
ELEMENT NAME |
|---|---|---|---|---|---|---|---|
1 |
4 |
SI |
O |
01024 |
Set ID- CM2 |
||
2 |
250 |
CE |
R |
9999 |
01025 |
Scheduled Time Point |
|
3 |
300 |
ST |
O |
01026 |
Description of Time Point |
||
4 |
250 |
CE |
R |
Y/200 |
9999 |
01027 |
Events Scheduled This Time Point |
Definition: This field contains a number that uniquely identifies this transaction for the purpose of adding, changing, or deleting the transaction. For those messages that permit segments to repeat, the Set ID field is used to identify the repetitions.
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field should correspond to the scheduled time point coding
system in Section <IP_ADDRESS>, "Study scheduled time point."
Definition: This field contains a brief explanation so recipients will understand what the time point represents.
Components:
<identifier (ST)> ^ <text (ST)> ^ <name of coding system
(IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^
<name of alternate coding system (IS)>
Definition: This field contains a study-specific event. Coding systems may be
developed for this field or applications may use facility-wide or standardized
orders and procedures coding systems. This enables integration of procedures
or events ordered for clinical trials with medical order entry systems.
This
example shows the lab system using the Master Files specification to send two
update test dictionary entries to an ICU system. The OM1 (observation
dictionary) segment, currently under development by HL7 and ASTM, carries the
dictionary information. Several varieties of acknowledgement are shown. The
choice of acknowledgment mode is site-specific.
Original mode example:
MSH|^~\&|LABxxx|ClinLAB|ICU||19910918060544||MFN^M03|MSGID002|P|2.2
MFI|LABxxx^Lab Test Dictionary^L|UPD|||AL
MFE|MUP|199109051000|199110010000|12345^WBC^L
OM1|...
MFE|MUP|199109051015|199110010000|6789^RBC^L
OM1|...
Original mode acknowledgment of the HL7 message according to MFI Response
Level Code of AL.
MSH|^~\&|ICU||LABxxx|ClinLAB|19910918060545||MFK|MSGID99002|P|2.2
MSA|AA|MSGID002
MFI|LABxxx^Lab Test Dictionary^L|UPD|||MFAA
MFA|MUP|199110010000|199110010040|S|12345^WBC^L
MFA|MUP|199110010000|199110010041|S|6789^RBC^L
Enhanced mode example
Initial message with accept acknowledgment
MSH|^~\&|LABxxx|ClinLAB|ICU||19910918060544||MFN^M03|MSGID002|P|2.2|||AL|AL
MFI|LABxxx^Lab Test Dictionary^L|UPD|||AL
MFE|MUP|199109051000|199110010000|12345^WBC^L
OM1|...
MFE|MUP|199109051015|199110010000|6789^RBC^L
OM1|...
MSH|^~\&|ICU||LABxxx|ClinLAB|19910918060545||MSA|MSGID99002|P|2.2
MSA|CA|MSGID002
Application acknowledgment message
MSH|^~\&|ICU||LABxxx|ClinLAB|19911001080504||MFK|MSGID5002|P|2.2|||AL|
MSA|AA|MSGID002
MFI|LABxxx^Lab Test Dictionary^L|UPD|||MFAA
MFA|MUP|199109051000|199110010040|S|12345^WBC^L
MFA|MUP|199109051015|199110010041|S|6789^RBC^L
MSH|^~\&|LABxxx|ClinLAB|ICU||19911001080507||ACK|MSGID444|P|2.2
MSA|CA|MSGID5002
Delayed application acknowledgment
Note: If the MFN message in Section 8.12, "Original mode example:," had
not required an application acknowledgment at the message level (i.e., the
application acknowledgment code of the MSH segment = NE), the (Master Files
Chapter defined) MFD message could be used to provide a delayed application
level acknowledgment not tied to the original MFN message.
The following example includes an acknowledgment for an MFE segment not in the
original message. This additional MFE was sent via another MFN message.
Initial message with accept acknowledgment
MSH|^~\&|LABxxx|ClinLAB|ICU||19910918060544||MFN^M03|MSGID002|P|2.2|||AL|NE
MFI|LABxxx^Lab Test Dictionary^L|UPD|||AL
MFE|MUP|199109051000|199110010000|12345^WBC^L
OM1|...
MFE|MUP|199109051015|199110010000|6789^RBC^L
OM1|...
MSH|^~\&|ICU||LABxxx|ClinLAB|19910918060545||MSA|MSGID99002|P|2.2
MSA|CA|MSGID002
Delayed application acknowledgment
MSH|^~\&|ICU||LABxxx|ClinLAB|19911001080504||MFD|MSGID65002|P|2.4|||AL|
MFI|LABxxx^Lab Test Dictionary^L|UPD|||MFAA
MFA|MUP|199109051000|199110010040|S|12345^WBC^L
MFA|MUP|199109051015|199110010041|S|6789^RBC^L
MFA|MUP|199109051025|199110010041|S|4339^HGB^L
MSH|^~\&|LABxxx|ClinLAB|ICU||19911001080507||ACK|MSGID444|P|2.4
MSA|CA|MSGID65002
We invite proposals for the specification of other HL7-wide master files segments.
LOINC Committee. Logical Observation
identifier Names and Codes. Indianapolis: Regenstrief Institute and LOINC
Committee, 1995.
[2] International Union of Pure and Applied
Chemistry/International Federation of Clinical Chemistry. The Silver Book:
Compendium of terminology and nomenclature of properties in clinical laboratory
sciences. Oxford: Blackwell Scientific Publishers, 1995.
[3] NCCLS Document H1-A3: Evacuated tubes for
blood specimen collection -- Third Edition, Volume 11, Number 9, Approved
standard. July 1991.


My Team
David Shaw
1
Email:
<EMAIL_ADDRESS>Manager
Office Number: 111
Engineer 1
2
Email:
<EMAIL_ADDRESS>Engineer
Github:
Profile
Engineer 2
3
Email:
<EMAIL_ADDRESS>Engineer
Github:
Profile
Intern 1
4
Email:
<EMAIL_ADDRESS>Intern
Code Bootcamp


JavaScript Date Output
By default, JavaScript will use the browser's time zone and display a date as a full text string: Fri Aug 07 2020 17:31:52 GMT+0530 (India Standard Time)
var d = new Date();
Creating Date Objects
Date objects are created with the new Date() constructor. There are 4 ways to create a new date object:
new Date()
new Date(year, month, day, hours, minutes, seconds, milliseconds)
new Date(milliseconds)
new Date(date string)
JavaScript Stores Dates as Milliseconds
SJavaScript stores dates as number of milliseconds since January 01, 1970, 00:00:00 UTC (Universal Time Coordinated).
Now the time is:<PHONE_NUMBER>987 milliseconds past January 01, 1970
new Date(milliseconds)
new Date(milliseconds) creates a new date object as zero time plus milliseconds:
var d = new Date(0);
JavaScript Get Date Methods
| Method | GDescription |
|---|---|
| getFullYear() | Get the year as a four digit number (yyyy) |
| getMonth() | Get the month as a number (0-11) |
| getDate()/td> | Get the day as a number (1-31) |
| getHours() | Get the hour (0-23) |
| getMinutes() | Get the minute (0-59) |
| getSeconds() | Get the second (0-59) |
| getMilliseconds() | Get the millisecond (0-999) |
| getTime() | Get the time (milliseconds since January 1, 1970) |
| getDay() | Get the weekday as a number (0-6) |
| Date.now() | GGet the time. ECMAScript 5. |


Last updated: 2021-10-07
Checks: 7 0
Knit directory: MINTIE-paper-analysis/
This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20200415)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 4606aca. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .DS_Store
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: analysis/.DS_Store
Ignored: analysis/cache/
Ignored: data/.DS_Store
Ignored: data/RCH_B-ALL/
Ignored: data/leucegene/.DS_Store
Ignored: data/leucegene/salmon_out/
Ignored: data/leucegene/sample_info/.DS_Store
Ignored: data/leucegene/sample_info/KMT2A-PTD_8-2.fa.xls
Ignored: output/Leucegene_gene_counts.tsv
Ignored: packrat/lib-R/
Ignored: packrat/lib-ext/
Ignored: packrat/lib/
Untracked files:
Untracked: data/leucegene/validation_results/TAP/
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were made to the R Markdown (analysis/Leucegene_Normals.Rmd
) and HTML (docs/Leucegene_Normals.html
) files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view the files as they were in that past version.
| File | Version | Author | Date | Message |
|---|---|---|---|---|
| Rmd | 4606aca | mcmero | 2021-10-07 | Increase fig 4 text size |
| html | c116fce | Marek Cmero | 2021-05-28 | Build site. |
| Rmd | ed3d2b6 | Marek Cmero | 2021-05-28 | Figures tweaks and reordering. |
| html | 4206f12 | Marek Cmero | 2021-04-30 | Build site. |
| Rmd | dde9f5b | Marek Cmero | 2021-04-30 | wflow_publish(files = list.files(pattern = "*Rmd")) |
| Rmd | 9595530 | Marek Cmero | 2021-04-30 | Updated analyses |
| html | 41431cc | Marek Cmero | 2020-07-07 | Build site. |
| html | 4b8113e | Marek Cmero | 2020-07-03 | Build site. |
| html | e9e4917 | Marek Cmero | 2020-06-24 | Build site. |
| Rmd | 9434bfe | Marek Cmero | 2020-06-24 | Updated results with latest MINTIE run. Fixed bug with KMT2A PTD checking in different controls. Added leucegene |
| html | b5825d3 | Marek Cmero | 2020-06-11 | Build site. |
| Rmd | c2c1c58 | Marek Cmero | 2020-06-11 | Fixed several tables to reflect paper more closely |
| html | 0b21347 | Marek Cmero | 2020-06-11 | Build site. |
| Rmd | fa6bf0c | Marek Cmero | 2020-06-11 | Updated with new results; improved tables |
| html | fa6bf0c | Marek Cmero | 2020-06-11 | Updated with new results; improved tables |
| html | 3702862 | Marek Cmero | 2020-05-18 | Removed MLM samples from final B-ALL results |
| html | a166ab8 | Marek Cmero | 2020-05-08 | Build site. |
| html | a600688 | Marek Cmero | 2020-05-07 | Build site. |
| html | 1c40e33 | Marek Cmero | 2020-05-07 | Build site. |
| Rmd | bbc278a | Marek Cmero | 2020-05-07 | Refactoring |
| html | 87b4e62 | Marek Cmero | 2020-05-07 | Build site. |
| Rmd | af503f2 | Marek Cmero | 2020-05-07 | Refactoring |
| html | 5c045b5 | Marek Cmero | 2020-05-07 | Build site. |
| html | 90c7fd9 | Marek Cmero | 2020-05-06 | Build site. |
| Rmd | ff4b1dc | Marek Cmero | 2020-05-06 | Leucegene results |
| html | 358aa53 | Marek Cmero | 2020-05-04 | Build site. |
| Rmd | 453d754 | Marek Cmero | 2020-05-04 | Added controls comparison in normals analysis. Added variant class collation function. Added variant summary for |
| html | 4a5d6ae | Marek Cmero | 2020-05-01 | Build site. |
| Rmd | 9556ebb | Marek Cmero | 2020-05-01 | Added leucegene normals analysis. Added expressed genes analysis to leucegene gene expression analysis. |
# util
library(data.table)
library(dplyr)
library(here)
library(stringr)
# plotting/tables
library(ggplot2)
library(gt)
options(stringsAsFactors = FALSE)
source(here("code/leucegene_helper.R"))
Here we generate the results presented in the MINTIE paper, of the method run on a set of non-cancer samples obtained from Leucegene.
# load MINTIE results from leucegene normals
normals_results_dir <- here("data/leucegene/normals_results")
normals_results <- list.files(normals_results_dir, full.names = TRUE) %>%
lapply(., read.delim) %>%
rbindlist(fill = TRUE) %>%
filter(logFC > 5)
# load cell type info and add to results
celltype <- read.delim(here("data/leucegene/sample_info/celltypes_info.tsv"))
normals_results <- inner_join(normals_results, celltype,
by = c("sample" = "SRX_ID"))
Summary results for variants called by MINTIE on Leucegene normals.
normals_results %>%
group_by(sample) %>%
summarise(variants = length(unique(variant_id))) %>%
summarise(min = min(variants),
median = median(variants),
max = max(variants)) %>%
gt() %>%
tab_header(
title = md("**Variants called by sample summary**")
) %>%
tab_options(
table.font.size = 12
) %>%
cols_label(
min = md("**Min**"),
median = md("**Median**"),
max = md("**Max**")
)
| Variants called by sample summary | ||
|---|---|---|
| Min | Median | Max |
| 61 | 122 | 1397 |
collate_vartypes(normals_results) %>%
group_by(class) %>%
summarise(variants = length(unique(variant_id))) %>%
mutate(fraction = variants / sum(variants)) %>%
gt() %>%
fmt_number(columns = vars(fraction), decimals = 3) %>%
tab_header(
title = md("**Variants called summary by class**")
) %>%
tab_options(
table.font.size = 12
) %>%
cols_label(
variants = md("**Variants**"),
fraction = md("**Fraction**")
)
| Variants called summary by class | ||
|---|---|---|
| class | Variants | Fraction |
| Fusion | 93 | 0.016 |
| Novel splice variant | 3180 | 0.562 |
| Transcribed structural variant | 1069 | 0.189 |
| Unknown | 1318 | 0.233 |
MINTIE paper Figure 4B showing the number of variant genes called across the Leucegene normal samples.
results_summary <- get_results_summary(mutate(normals_results, group_var = cell_type),
group_var_name = "cell_type")
results_summary %>%
summarise(min = min(V1),
median = median(V1),
max = max(V1),
total = sum(V1)) %>%
gt() %>%
tab_header(
title = md("**Variant genes called by sample summary**")
) %>%
tab_options(
table.font.size = 12
) %>%
cols_label(
min = md("**Min**"),
median = md("**Median**"),
max = md("**Max**"),
total = md("**Total**")
)
| Variant genes called by sample summary | |||
|---|---|---|---|
| Min | Median | Max | Total |
| 64 | 117 | 465 | 3482 |
ggplot(results_summary, aes(cell_type, V1, group=sample)) +
geom_bar(position = position_dodge2(width = 0.9, preserve = "single"), stat = "identity") +
theme_bw() +
theme(axis.text.x = element_text(size = 11),
axis.text.y = element_text(size = 11)) +
xlab("") +
ylab("Genes with variants")
Perform correlation calculation on the library size and number of variant genes found per sample.
Leucegene Gene Expression notebook must be run before this chunk to generate the expression counts matrix.
# load counts data, calculate library sizes and add to results summary
counts <- fread(here("output/Leucegene_gene_counts.tsv"))
libsizes <- apply(counts, 2, sum) %>% data.frame()
colnames(libsizes) <- "libsize"
libsizes$sample <- factor(rownames(libsizes),
levels = results_summary$sample)
results_summary <- left_join(results_summary, libsizes, by ="sample", "sample")
lib_var_cor <- cor(results_summary$libsize, results_summary$V1, method = "spearman")
print(paste("Spearman correlation between library size and variant genes called:", lib_var_cor))
[1] "Spearman correlation between library size and variant genes called: 0.210474308300395"
ggplot(results_summary, aes(libsize, V1, colour = cell_type)) +
geom_point() +
theme_bw() +
ylab("Genes with variants")
Proportion of protein coding genes observed in the MINTIE results.
# load CHESS gene reference containing gene types
chess_genes <- get_chess_genes(gzfile(here("data/ref/chess2.2.genes.gz")))
# join gene info with results and summarise by gene type
results_by_gene <- get_results_by_gene(normals_results)
gene_count <- left_join(results_by_gene, chess_genes, by = "gene") %>%
group_by(Gene_Type) %>%
summarise(n_genes = length(unique(gene))) %>%
data.table()
n_protein_coding <- gene_count[gene_count$Gene_Type == "protein_coding", "n_genes"]
n_var_genes <- sum(gene_count$n_genes)
paste("proportion of protein coding genes =",
(n_protein_coding / n_var_genes) %>% round(4),
paste0("(", n_protein_coding, "/", n_var_genes, ")")) %>%
print()
[1] "proportion of protein coding genes = 0.8333 (1969/2363)"
MINTIE Supplementary Figure 4 showing variant genes called in Leucegene Total White Blood Cell samples with different cell types as control groups.
# get TWBC results
controls_comp <- normals_results[normals_results$cell_type == "Total white blood cells",]
controls_comp$controls <- "twbc"
controls_comp$cell_type <- NULL
# load comparisons against all other controls
controls_test_dir <- here("data/leucegene/normals_controls_test_results")
controls_comp <- load_controls_comparison(controls_test_dir) %>%
rbind(controls_comp, ., fill = TRUE)
results_summary <- get_results_summary(mutate(controls_comp,
group_var = controls),
group_var_name = "controls")
results_summary %>%
group_by(controls) %>%
summarise(tcount = sum(V1)) %>%
gt() %>%
tab_header(
title = md("**Total variant genes called using different controls**")
) %>%
tab_options(
table.font.size = 12
) %>%
cols_label(
controls = md("**Controls**"),
tcount = md("**Variant genes**")
)
| Total variant genes called using different controls | |
|---|---|
| Controls | Variant genes |
| twbc | 412 |
| mono | 715 |
| gran | 763 |
| tc | 1564 |
| bc | 1630 |
ggplot(results_summary, aes(sample, V1, fill=controls)) +
geom_bar(position=position_dodge2(width=0.9, preserve="single"), stat="identity") +
theme_bw() +
xlab("") +
ylab("Genes with variants") +
scale_fill_brewer(palette = "RdYlBu",
labels = c("mono" = "Monocytes",
"twbc" = "Total white blood cells",
"gran" = "Granulocytes",
"tc" = "T-Cells",
"bc" = "B-Cells"))
MINTIE Figure 4C showing range of variant genes called in granulocytes with different combinations of 1..N controls. The table output also includes numbers for the runs where 0 controls were used.
# load in data
ncon_dirs <- here("data/leucegene/normals_ncontrols_test_results/")
ncon_results <- data.frame()
for (ncon_dir in list.dirs(ncon_dirs, recursive = FALSE)) {
run <- str_split(ncon_dir, "ncon")[[1]] %>%
tail(1)
ncon <- str_split(run, "r") %>% unlist() %>% head(1) %>% as.numeric()
results <- list.files(ncon_dir, pattern = "*results.tsv.gz", full.names = TRUE) %>%
lapply(., read.delim) %>%
rbindlist() %>%
get_results_by_gene() %>%
mutate(n_controls = ncon, run = run)
ncon_results <- rbindlist(list(ncon_results, results), fill = TRUE)
}
ncon_results <- ncon_results[logFC > 5 | is.na(logFC),]
# prepare results summary
results_summary <- get_results_summary(mutate(ncon_results,
group_var = run),
group_var_name = "run")
results_summary$n_controls <- results_summary$run %>%
as.character() %>%
str_split(., pattern = "r") %>%
lapply(., head, n=1) %>% unlist() %>% as.numeric()
rs <- results_summary %>%
group_by(sample, n_controls) %>%
summarise(mean=round(mean(V1, na.rm=TRUE)),
min=min(V1, na.rm=TRUE),
max=max(V1, na.rm=TRUE)) %>%
data.frame()
rs %>%
gt() %>%
tab_header(
title = md("**Total variant genes called using different numbers of controls**")
) %>%
tab_options(
table.font.size = 12
) %>%
cols_label(
n_controls = md("**Controls**"),
mean = md("**Mean**"),
min = md("**Min**"),
max = md("**Max**")
)
| Total variant genes called using different numbers of controls | ||||
|---|---|---|---|---|
| sample | Controls | Mean | Min | Max |
| SRX372056 | 0 | 4129 | 4129 | 4129 |
| SRX372056 | 1 | 186 | 155 | 220 |
| SRX372056 | 2 | 140 | 132 | 155 |
| SRX372056 | 3 | 100 | 99 | 102 |
| SRX372056 | 4 | 80 | 80 | 80 |
| SRX372054 | 0 | 5079 | 5079 | 5079 |
| SRX372054 | 1 | 214 | 200 | 229 |
| SRX372054 | 2 | 123 | 113 | 139 |
| SRX372054 | 3 | 100 | 96 | 103 |
| SRX372054 | 4 | 75 | 75 | 75 |
| SRX372053 | 0 | 4570 | 4570 | 4570 |
| SRX372053 | 1 | 292 | 168 | 346 |
| SRX372053 | 2 | 227 | 102 | 295 |
| SRX372053 | 3 | 190 | 88 | 291 |
| SRX372053 | 4 | 72 | 72 | 72 |
| SRX372055 | 0 | 6063 | 6063 | 6063 |
| SRX372055 | 1 | 431 | 368 | 469 |
| SRX372055 | 2 | 249 | 226 | 266 |
| SRX372055 | 3 | 218 | 212 | 225 |
| SRX372055 | 4 | 175 | 175 | 175 |
| SRX372052 | 0 | 4543 | 4543 | 4543 |
| SRX372052 | 1 | 789 | 148 | 1051 |
| SRX372052 | 2 | 750 | 170 | 1040 |
| SRX372052 | 3 | 598 | 185 | 1011 |
| SRX372052 | 4 | 209 | 209 | 209 |
rs$n_controls <- as.factor(rs$n_controls)
ggplot(rs[rs$n_controls!=0,], aes(sample, mean, fill=n_controls)) +
geom_bar(position=position_dodge2(width=0.9, preserve="single"), stat="identity") +
geom_errorbar(aes(ymin=min, ymax=max, group=n_controls), width=.2,
position=position_dodge(.9)) +
theme_bw() +
theme(axis.text.x = element_text(size = 11),
axis.text.y = element_text(size = 11)) +
xlab("") +
ylab("Mean genes with variants") +
scale_fill_brewer(palette = "Dark2") +
theme(legend.position = "bottom")
sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] gt_0.3.1 ggplot2_3.3.5 stringr_1.4.0 here_1.0.1
[5] dplyr_1.0.7 data.table_1.14.0 workflowr_1.6.2
loaded via a namespace (and not attached):
[1] tidyselect_1.1.1 xfun_0.25 purrr_0.3.4 colorspace_2.0-2
[5] vctrs_0.3.8 generics_0.1.0 htmltools_0.5.2 yaml_2.2.1
[9] utf8_1.2.2 rlang_0.4.11 jquerylib_0.1.4 later_1.3.0
[13] pillar_1.6.2 glue_1.4.2 withr_2.4.2 DBI_1.1.1
[17] RColorBrewer_1.1-2 lifecycle_1.0.0 munsell_0.5.0 commonmark_1.7
[21] gtable_0.3.0 evaluate_0.14 labeling_0.4.2 knitr_1.33
[25] fastmap_1.1.0 httpuv_1.6.3 fansi_0.5.0 highr_0.9
[29] Rcpp_1.0.7 promises_<IP_ADDRESS> scales_1.1.1 backports_1.2.1
[33] checkmate_2.0.0 farver_2.1.0 fs_1.5.0 digest_0.6.27
[37] stringi_1.7.4 rprojroot_2.0.2 grid_4.1.1 tools_4.1.1
[41] magrittr_2.0.1 sass_0.4.0 tibble_3.1.4 crayon_1.4.1
[45] whisker_0.4 pkgconfig_2.0.3 ellipsis_0.3.2 assertthat_0.2.1
[49] rmarkdown_2.11 R6_2.5.1 git2r_0.28.0 compiler_4.1.1


Responsive with CSS Grid
CSS Grid Layout is an adaptable similar to flexbox resource that works in an bidimensional way, similar to table but as an upgrade, it was already explained on a previous article.
Responsive Web Design is about using HTML and CSS to automatically resize, hide, shrink, or enlarge,
a website, to make it look good on all devices: (desktops, tablets, and phones).
- desktops
- tablets
- smartphones
- smart TV
- etc..
Before trying to understand the code needed or common changes, we need to understand that in the <head> we need to put a special meta <meta>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
We have to take into account that we have another tools to archieve a responsive design, such
as setting max-width or min-width, for
pictures when can even change the source
depending on some conditions with the use of @media, which we'll se
later.
<picture> <source srcset="img_smallflower.jpg" media="(max-width: 600px)"> <source srcset="img_flowers.jpg" media="(max-width: 1500px)"> <source srcset="flowers.jpg"> <img src="img_smallflower.jpg" alt="Flowers"> </picture>
Therefore, with our viewport setted up, the browser will automatically know how to behave
We also have a unit called vw (Viewport Width) and vh (Viewport Height), which basically gets the viewport current height and width allowing you to work on a more adaptable way, it's how this website is actually built.
Understanding media
The @media in responsive design is the display that you want to focus
on,
screen being the most used, and here's there full list:
- all: used for all media type devices
- print: used for printers
- screen: used for computer screens, tablets, smart-phones etc.
- speech: used for screenreaders that "reads" the page out loud


Destination Event Services (DES)
Destination Event Services is a full service destination management company providing extraordinary experiences and special events in all realms of businesses.
At Destination Event Services, we pride ourselves in our attention to detail and we strive to exceed all of our clients’ expectations by first listening to their needs and attend to every detail to make the planning of their event as seamless as possible.
"DES NY, the Destination Starts Here."


ktor-server-core
/
io.ktor.request
/
ApplicationReceivePipeline
/
After
After
val
After
:
PipelinePhase


"Atlantis: The Lost Empire"
Young Milo Thatch (voice of Michael J. Fox) has the heart of an adventurer. When a long lost and very old journal, once found by his explorer grandfather, surfaces, the cartographer/linguistics expert becomes the key to unraveling an ancient mystery in Disney's latest animation, "Atlantis: The Lost Empire."
Disney Studios has played the release of "Atlantis" very close, too close, to the chest for a potential animation blockbuster, so I had mixed feelings of anticipation when we attended a Saturday morning kids' screening. Then, the MPAA rating came up on the screen - Rated PG. What's this? A Disney summer anime with a PG rating? I suspected, at this point, that something good was up.
The movie starts with our soon-to-be hero, Milo, lecturing his "colleagues" on the existence of the lost continent of Atlantis. It turns out he's just pretending as he prepares to present his theory to his doubtful boss, Mr. Harcourt (voice of David Ogden Stiers). Unfortunately for Milo, Harcourt considers the theory - Atlantis is in Iceland - absurd. But, when a gorgeous blonde, Helga (voice of Claudia Christian), sets up a meeting with eccentric billionaire Preston B. Whitmore (voice of John Mahoney), Milo finally finds someone who will listen to him.
Not only does Whitmore listen, he has already invested enormous sums of money preparing for an expedition to find lost Atlantis and has been waiting for someone with Milo's unique talents to join his team. In charge of the mission is the burly Commander Rourke (voice of James Garner) who leads his crew, in an enormous submarine, to the map coordinates dictated by Milo from the ancient journal.
When the team reaches the undersea entrance to Atlantis, Leviathan, a huge, metal, lobster-like guarding the doorway to the lost land, attacks them. Rourke orders an attack on the beast and launches a phalanx of mini-subs. They are only partly effective in stopping the metal monster and most of the crew of 200 is lost. As the remaining explorers journey, heavily armed and equipped, into Atlantis, Milo and the rest soon learn that they are not entering a dead archaeological site but a living, breathing land teaming with life, including the Atlanteans, and Milo is the only one who speaks the language.
It's at this point that the story shifts gears from adventure and a search for the ancient culture to one of intrigue. The mythical power source that allowed the advanced evolution of the Atlaneans comes to the attention of Rourke and his henchmen and they plan to take the treasured crystal for their own gain. At the same time, Milo falls for a beautiful Atlantean, Princess Kida (Cree Summer), and learns that the land and its power supply are slowly dying. Only he can read the ancient runes and save Atlantis, but is it too little, too late in the face of the invaders?
Much in the tradition of Jules Verne adventures, "Atlantis: the Lost Empire" melds past period setting with the futuristic. Such adventures as "20,000 Leagues Under the Sea" and "Journey to the Center of the Earth" come to mind as the high-tech action of "Atlantis" kicks in and animated splendor of Disney comes to the fore. This is, visually, one of the most advanced animation works to come out of the industry giant. The deep canvas background animation developed for "Tarzan" is used liberally, giving the proceeds a live action look and feel. The combination of traditional cell animation and computer-generated imagery (CGI) is seamless, with fluidity of movement that, too, harkens to live adventure/action films.
There is a big cast of vocal talent accompanying Michael J. Fox - who gives na´ve, boyish charm to his intelligent, kind Milo. James Garner gives a good twist as his Commander Rourke shifts from benign leader to ruthless mercenary, along with his babe henchlady, Helga (Christian), who is one tough chick. There is an ample supply of comic relief provided by the other vocal cast and their characters. The late Jim Varney lends his drawl one last time in the guise of Cookie, whose idea of nutrition is meat along with great quantities of grease. Don Novello (Father Guido Sarducci) lends his vocal talent as the sardonic, carefree explosives expert, Vinny Santorini. Florence Stanley (TV's "Barney Miller" and "Fish") is a riot as the chain-smoking, curmudgeon communications office, Mrs. Packard, in a vocal perf that would have made Thelma Ritter proud. Vocal talent Corey Burton provides and outrageous French accent to his character "Mole" Moliere, the team's earth digger. Leonard Nimoy provides dignity to the voice of the king of Atlantis.
The production owes a great deal to other animations that have preceded it. Elements from such films as Ralph Bakshi's "Wizards," "The Iron Giant" and "Beauty and the Beast" are evident, as are the aforementioned Jules Verne adaptations to the screen. These various antecedents may have influenced "Atlantis," but the makers take these elements and spin them into a fresh, rip-roaring action/adventure that will please older kids through to the adults. Younger kids will be left behind with this more adult-oriented Disney animation, so send them to see "Shrek" instead.
I give it a B+.
For more Reeling reviews visit www.reelingreviews.com
<EMAIL_ADDRESS><EMAIL_ADDRESS>The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


This page lists all existing filters, and can be used to create new ones, or edit and delete those that already exist. You should be careful when removing or changing those that were setup by default, as they often select critical log messages or are important to the functioning of the system. However, it is quite safe to add your own filters.
Syslog-NG allows filters to be extemely complex and make use of boolean logic to match messages. When editing a filter, you can select to use a simple set of rules for choosing which of the facility, priority, contents, hostname and IP the filter matches on. Or you can choose to enter a Syslog-NG boolean expression directly, which should only be used if you are familiar with its configuration file format.